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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_adapters.py | test_from_pydantic | assert | func_call | 23 | import enum
from typing import List, Union
import pydantic
import pytest
from pydantic.fields import Field
from kor.adapters import _translate_pydantic_to_kor, from_pydantic
from kor.nodes import Number, Object, Option, Optional, Selection, Text
def test_from_pydantic() -> None:
"""Test from pydantic function.""... | Object( id="toy", attributes=[Text(id="a"), Number(id="b")], ) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_adapters.py | test_convert_pydantic_with_union | assert | func_call | 21 | import enum
from typing import List, Union
import pydantic
import pytest
from pydantic.fields import Field
from kor.adapters import _translate_pydantic_to_kor, from_pydantic
from kor.nodes import Number, Object, Option, Optional, Selection, Text
def test_convert_pydantic_with_union() -> None:
"""Test behavior wi... | Object( id="toy", attributes=[ Text( # Any union type of primitives is mapped to a text field for now. id="a" ), ], ) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_adapters.py | test_convert_pydantic_with_enum | assert | func_call | 29 | import enum
from typing import List, Union
import pydantic
import pytest
from pydantic.fields import Field
from kor.adapters import _translate_pydantic_to_kor, from_pydantic
from kor.nodes import Number, Object, Option, Optional, Selection, Text
def test_convert_pydantic_with_enum() -> None:
"""Test conversion w... | Object( id="toy", attributes=[ Selection( id="single_choice", options=[ Option(id="a"), Option(id="b"), Option(id="c"), ], examples=[("a", "a")], ), Selection( id="multiple_choices", many=True, options=[ Option(id="a"), Option(id="b"), Option(id="c"), ], examples=[("a b", ["a", "b"])], ), ], ) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_adapters.py | test_convert_pydantic | assert | func_call | 33 | import enum
from typing import List, Union
import pydantic
import pytest
from pydantic.fields import Field
from kor.adapters import _translate_pydantic_to_kor, from_pydantic
from kor.nodes import Number, Object, Option, Optional, Selection, Text
def test_convert_pydantic() -> None:
"""Convert a pydantic object t... | Object( id="toy", attributes=[ Text(id="a", description="hello"), Number(id="b", examples=[("b is 1", "1")]), Number(id="c"), Text(id="d"), # We do not support boolean types yet. # We don't have optional yet internally, so we don't check the # optional setting. Number(id="e"), # We don't have a boolean type yet. Number... | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_xml_encoding | assert | variable | 50 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | expected | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_json_encoding | assert | variable | 46 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | node_data | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_json_encoding_with_tags | assert | string_literal | 34 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | '<json>{"object": [{"a": 1}]}</json>' | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_json_encoding_with_tags | assert | collection | 38 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | { "object": [{"a": 1}] } | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_encode_examples | assert | collection | 40 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | [ ("input", "output"), ("input2", "output2"), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_encode_examples | assert | collection | 50 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | [ ('"""\ninput\n"""', "output"), ('"""\ninput2\n"""', "output2"), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_encode_examples | assert | collection | 35 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | [ ("input", '<json>"output"</json>'), ("input2", '<json>"output2"</json>'), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_encoders.py | test_encode_examples | assert | collection | 45 | from typing import Any
import pytest
from kor.encoders import Encoder, JSONEncoder, XMLEncoder, encode_examples
from kor.nodes import AbstractSchemaNode, Number, Object, Option, Selection, Text
def _get_schema() -> AbstractSchemaNode:
"""Make an abstract input node."""
option = Option(id="option", descriptio... | [ ('Text: """\ninput\n"""', "output"), ('Text: """\ninput2\n"""', "output2"), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_utils.py | test_unwrap_tag | assert | none_literal | 7 | from kor.encoders.utils import unwrap_tag, wrap_in_tag
def test_unwrap_tag() -> None:
"""Test unwrap_tag."""
# Test with an empty string
assert unwrap_tag("", "") is | None | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_utils.py | test_unwrap_tag | assert | string_literal | 13 | from kor.encoders.utils import unwrap_tag, wrap_in_tag
def test_unwrap_tag() -> None:
"""Test unwrap_tag."""
# Test with an empty string
assert unwrap_tag("", "") is None
# Test with a string that doesn't contain the tag
assert unwrap_tag("table", "This is some text.") is None
# Test with a s... | "hello" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_utils.py | test_wrap_in_tag | assert | string_literal | 6 | from kor.encoders.utils import unwrap_tag, wrap_in_tag
def test_wrap_in_tag() -> None:
"""Test wrap_in_tag."""
assert wrap_in_tag("table", "hello") == | "<table>hello</table>" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_xml_decode | assert | variable | 29 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
@pytest.mark.parametrize(
"xml_string,output",
[
("", {}),
("<123>", {}),
("<d>blah</d>", {"d": ["blah"]}),
("<a>1</a><a>2</a>", {"a": ["1", "2"]}),
("<a>1</a><b>2</b>... | output | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_xml_encode | pytest.raises | variable | 36 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
@pytest.mark.parametrize(
"obj,output",
[
({}, ""),
("hello", TypeError),
({"obj": []}, ""),
({"obj": 5}, "<obj>5</obj>"),
({"obj": {"name": ["Eugene"]}}, "<obj><name>... | output) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_write_tag | assert | string_literal | 10 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
def test_write_tag() -> None:
"""Verify XML encoding works as expected."""
assert _write_tag("tag", "data") == | "<tag>data</tag>" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_write_tag | assert | string_literal | 12 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
def test_write_tag() -> None:
"""Verify XML encoding works as expected."""
assert _write_tag("tag", "data") == "<tag>data</tag>"
assert _write_tag("tag", ["data1", "data2"]) == "<tag>data1</tag><tag>data... | "<tag><key1>value1</key1></tag>" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_write_tag | assert | string_literal | 11 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
def test_write_tag() -> None:
"""Verify XML encoding works as expected."""
assert _write_tag("tag", "data") == "<tag>data</tag>"
assert _write_tag("tag", ["data1", "data2"]) == | "<tag>data1</tag><tag>data2</tag>" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_write_tag | assert | string_literal | 13 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
def test_write_tag() -> None:
"""Verify XML encoding works as expected."""
assert _write_tag("tag", "data") == "<tag>data</tag>"
assert _write_tag("tag", ["data1", "data2"]) == "<tag>data1</tag><tag>data... | "<tag><key1>value1</key1><key2>value2</key2></tag>" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_encoders/test_xml.py | test_write_tag | assert | string_literal | 17 | from typing import Any, Type, Union
import pytest
from kor.encoders.xml import XMLEncoder, _write_tag
def test_write_tag() -> None:
"""Verify XML encoding works as expected."""
assert _write_tag("tag", "data") == "<tag>data</tag>"
assert _write_tag("tag", ["data1", "data2"]) == "<tag>data1</tag><tag>data... | "<tag><key1>value1</key1><key2>a</key2><key2>b</key2></tag>" | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_examples.py | test_example_generation | assert | collection | 33 | from kor.examples import generate_examples
from kor.nodes import Number, Object, Option, Selection, Text
def test_example_generation() -> None:
"""Light-weight test for example generator.
Verifies that examples are getting picked up and encoded properly.
"""
option = Option(id="option", description="O... | [ ("another number", {"object": [{"number": "1"}]}), ("number", {"object": [{"number": ["2"]}]}), ("text", {"object": [{"text": ["3"]}]}), ("selection", {"object": [{"selection": ["option"]}]}), ("foo", {}), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_examples.py | test_example_generation_with_plain_encoding | assert | collection | 46 | from kor.examples import generate_examples
from kor.nodes import Number, Object, Option, Selection, Text
def test_example_generation_with_plain_encoding() -> None:
"""Light test for plain encoding."""
option = Option(id="option", description="Option", examples=["selection"])
number = Number(
id="nu... | [ ("another number", {"object": [{"number": ["1"]}]}), ("number", {"object": [{"number": ["2"]}]}), ("text", {"object": [{"text": ["3"]}]}), ("selection", {"object": [{"selection": ["option"]}]}), ("foo", {}), ("1 2", {"object": [{"age": ["1", "2"]}]}), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_object_examples | assert | collection | 17 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_object_examples() -> None:
"""Object examples.
Verifying that examples do not get re-interpreted in a strange way. The reason
for these tests is that we're using pydantic and pydantic does auto-coer... | [] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_extraction_input_cannot_be_instantiated | pytest.raises | variable | 11 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_extraction_input_cannot_be_instantiated() -> None:
"""ExtractionInput is abstract and should not be instantiated."""
with pytest.raises( | TypeError) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_invalid_identifier_raises_error | pytest.raises | variable | 11 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
@pytest.mark.parametrize("invalid_id", ["", "@@#", " ", "NAME", "1name", "name-name"])
def test_invalid_identifier_raises_error(invalid_id: str) -> None:
with pytest.raises( | ValueError) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_text_examples | assert | collection | 20 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_text_examples() -> None:
"""Text examples.
Verify that examples do not get re-interpreted in a strange way.
"""
assert nodes.Text(
id="text",
description="description",
e... | [("input", "")] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_text_examples | assert | collection | 14 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_text_examples() -> None:
"""Text examples.
Verify that examples do not get re-interpreted in a strange way.
"""
assert nodes.T | [("input", "output")] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_object_examples | assert | collection | 28 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_object_examples() -> None:
"""Object examples.
Verifying that examples do not get re-interpreted in a strange way. The reason
for these tests is that we're using pydantic and pydantic does auto-coer... | [("input", {"key1": "value1"})] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_object_examples | assert | collection | 36 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_object_examples() -> None:
"""Object examples.
Verifying that examples do not get re-interpreted in a strange way. The reason
for these tests is that we're using pydantic and pydantic does auto-coer... | [("input", [{"a": "1", "b": "2"}, {"a": "3", "b": "4"}])] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_nodes.py | test_object_examples | assert | collection | 45 | from typing import Any
import pytest
from kor import nodes
from kor.nodes import AbstractVisitor
def test_object_examples() -> None:
"""Object examples.
Verifying that examples do not get re-interpreted in a strange way. The reason
for these tests is that we're using pydantic and pydantic does auto-coer... | [ ("input", [{"a": "1", "b": "2"}, {"a": "3", "b": "4"}]), ("input2", {}), ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_prompt_generation.py | test_input_formatter_applied_correctly | assert | variable | 33 | import pytest
from kor import JSONEncoder, Object, TypeScriptDescriptor
from kor.encoders import InputFormatter
from kor.prompts import create_langchain_prompt
@pytest.mark.parametrize(
"input_formatter, expected_string",
[
(None, "user input"),
("triple_quotes", '"""\nuser input\n"""'),
... | expected_string | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_prompt_generation.py | test_input_formatter_applied_correctly | assert | func_call | 34 | import pytest
from kor import JSONEncoder, Object, TypeScriptDescriptor
from kor.encoders import InputFormatter
from kor.prompts import create_langchain_prompt
@pytest.mark.parametrize(
"input_formatter, expected_string",
[
(None, "user input"),
("triple_quotes", '"""\nuser input\n"""'),
... | prompt_value.to_string() | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_public_interface.py | test_kor__all__ | assert | collection | 9 | from kor import __all__
def test_kor__all__() -> None:
"""Hard-code contents of __all__.
Upon changes this may help serve as a reminder to correctly bump the semver.
"""
assert sorted(__all__) == | [ "BulletPointDescriptor", "CSVEncoder", "DocumentExtraction", "Extraction", "JSONEncoder", "Number", "Object", "Option", "Selection", "Text", "TypeDescriptor", "TypeScriptDescriptor", "XMLEncoder", "__version__", "create_extraction_chain", "extract_from_documents", "from_pydantic", ] | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_type_descriptors.py | test_bullet_point_descriptions | assert | variable | 55 | import pytest
from kor import Number, Object, Text
from kor.nodes import Option, Selection
from kor.type_descriptors import BulletPointDescriptor, TypeScriptDescriptor
OPTION_1 = Option(id="blue", description="Option Description", examples=["blue"])
OPTION_2 = Option(id="red", description="Red color", examples=["red"... | description | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_validators.py | test_pydantic_validator | assert | numeric_literal | 34 | from pydantic import BaseModel, ValidationError
from pydantic import validator as pydantic_validator
from kor.validators import (
PydanticValidator,
)
def test_pydantic_validator() -> None:
"""Test the PydanticValidator wrapper around pydantic."""
class ToyModel(BaseModel):
"""Toy model for testi... | 1 | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_validators.py | test_pydantic_validator | assert | none_literal | 33 | from pydantic import BaseModel, ValidationError
from pydantic import validator as pydantic_validator
from kor.validators import (
PydanticValidator,
)
def test_pydantic_validator() -> None:
"""Test the PydanticValidator wrapper around pydantic."""
class ToyModel(BaseModel):
"""Toy model for testi... | None | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_validators.py | test_pydantic_validator | assert | collection | 27 | from pydantic import BaseModel, ValidationError
from pydantic import validator as pydantic_validator
from kor.validators import (
PydanticValidator,
)
def test_pydantic_validator() -> None:
"""Test the PydanticValidator wrapper around pydantic."""
class ToyModel(BaseModel):
"""Toy model for testi... | ( ToyModel(name="Eugene", age=5), [], ) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
eyurtsev/kor | 7291946816782a70d2514445229a710eddcd7060 | 46 | train | train | tests/test_visitors.py | test_visit_default_is_invoked | assert | collection | 28 | from typing import Any, Tuple
import pytest
from kor.nodes import (
AbstractSchemaNode,
AbstractVisitor,
Number,
Object,
Option,
Selection,
Text,
)
@pytest.mark.parametrize(
"node",
[
Number(id="uid"),
Text(id="uid"),
Object(id="uid", attributes=[]),
... | ("uid", {"a": "a", "b": "b"}) | 7291946816782a70d2514445229a710eddcd7060 | 46 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_auth.py | test_api_accessible_without_auth | assert | numeric_literal | 20 | import pytest
pytestmark = [pytest.mark.e2e]
class TestSetupModeBypass:
@pytest.mark.parametrize("path", [
"/api/certificates",
"/api/backups",
"/api/users",
"/api/auth/config",
"/api/web/settings",
"/api/web/cache/stats",
"/api/client-certs",
"/api... | 200 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_auth.py | test_auth_me_returns_401_without_session | assert | numeric_literal | 11 | import pytest
pytestmark = [pytest.mark.e2e]
class TestAuthConfig:
def test_auth_me_returns_401_without_session(self, api):
"""/api/auth/me should return 401 when no session exists."""
r = api.get("/api/auth/me")
assert r.status_code == | 401 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_auth.py | test_get_auth_config | assert | variable | 12 | import pytest
pytestmark = [pytest.mark.e2e]
class TestAuthConfig:
def test_get_auth_config(self, api):
r = api.get("/api/auth/config")
assert r.status_code == 200
data = r.json()
assert "local_auth_enabled" in | data | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_auth.py | test_health_always_accessible | assert | string_literal | 12 | import pytest
pytestmark = [pytest.mark.e2e]
class TestSetupModeBypass:
def test_health_always_accessible(self, api):
r = api.get("/health")
assert r.status_code == 200
data = r.json()
assert data["status"] == | "healthy" | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_auth.py | test_create_and_delete_user | assert | collection | 15 | import pytest
pytestmark = [pytest.mark.e2e]
class TestUserManagement:
def test_create_and_delete_user(self, api):
# Create
r = api.post_json("/api/users", {
"username": "testuser",
"password": "TestPass123!",
"role": "user",
})
assert r.status... | (200, 201) | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_auth.py | test_create_and_delete_user | assert | func_call | 20 | import pytest
pytestmark = [pytest.mark.e2e]
class TestUserManagement:
def test_create_and_delete_user(self, api):
# Create
r = api.post_json("/api/users", {
"username": "testuser",
"password": "TestPass123!",
"role": "user",
})
assert r.status_... | data.get("users", {}) | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_05_download_tls_components | assert | numeric_literal | 41 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | 50 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_02_certificate_in_list | assert | numeric_literal | 38 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | 200 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_04_download_zip | assert | numeric_literal | 39 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | 100 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_03_certificate_exists | assert | none_literal | 42 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | None | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_02_certificate_in_list | assert | variable | 43 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | domains | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_01_create_certificate | assert | collection | 43 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | (200, 201) | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_cert_lifecycle.py | test_06_renew_certificate | assert | collection | 39 | import os
import uuid
import zipfile
import io
import pytest
pytestmark = [pytest.mark.e2e, pytest.mark.slow]
BASE_DOMAIN = os.environ.get("CERTMATE_TEST_DOMAIN", "gpfree.org")
TEST_EMAIL = os.environ.get("CERTMATE_TEST_EMAIL", "test@gpfree.org")
_run_id = uuid.uuid4().hex[:8]
TEST_DOMAIN = f"e2e-{_run_id}.{BASE_DOM... | (200, 400) | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_pages.py | test_page_returns_200 | assert | numeric_literal | 18 | import pytest
pytestmark = [pytest.mark.e2e]
class TestPageLoading:
@pytest.mark.parametrize("path", [
"/",
"/settings",
"/help",
"/client-certificates",
"/redoc",
"/health",
])
def test_page_returns_200(self, api, path):
r = api.get(path, allow_red... | 200 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_pages.py | test_index_shows_welcome | assert | complex_expr | 10 | import pytest
pytestmark = [pytest.mark.e2e]
class TestWelcomeBanner:
def test_index_shows_welcome(self, api):
r = api.get("/", allow_redirects=True)
assert "Welcome to CertMate" in | r.text | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_settings.py | test_load_initial_settings | assert | numeric_literal | 10 | import pytest
pytestmark = [pytest.mark.e2e]
class TestSettingsLoad:
def test_load_initial_settings(self, api):
r = api.get("/api/web/settings")
assert r.status_code == | 200 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_settings.py | test_list_accounts_after_create | assert | variable | 15 | import pytest
pytestmark = [pytest.mark.e2e]
class TestDNSProviderAccounts:
def test_list_accounts_after_create(self, api):
r = api.get("/api/dns/cloudflare/accounts")
assert r.status_code == 200
data = r.json()
# Should contain our test account
accounts = data if isinstan... | ids | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_settings.py | test_load_initial_settings | assert | variable | 12 | import pytest
pytestmark = [pytest.mark.e2e]
class TestSettingsLoad:
def test_load_initial_settings(self, api):
r = api.get("/api/web/settings")
assert r.status_code == 200
data = r.json()
assert "dns_provider" in | data | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_settings.py | test_save_and_reload | assert | variable | 16 | import pytest
pytestmark = [pytest.mark.e2e]
class TestSettingsSave:
def test_save_and_reload(self, api):
email = "reload-test@example.com"
api.post_json("/api/web/settings", {
"email": email,
"dns_provider": "cloudflare",
})
r = api.get("/api/web/settings"... | email | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_static_csp.py | test_static_asset_returns_200 | assert | numeric_literal | 20 | import pytest
pytestmark = [pytest.mark.e2e]
class TestStaticFiles:
@pytest.mark.parametrize("path", [
"/static/css/tailwind.min.css",
"/static/css/fontawesome.min.css",
"/static/webfonts/fa-solid-900.woff2",
"/static/webfonts/fa-regular-400.woff2",
"/static/webfonts/fa-br... | 200 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_static_csp.py | test_csp_no_external_cdn | assert | variable | 13 | import pytest
pytestmark = [pytest.mark.e2e]
class TestCSPHeaders:
@pytest.mark.parametrize("path", ["/", "/settings", "/help", "/client-certificates"])
def test_csp_no_external_cdn(self, api, path):
r = api.get(path, allow_redirects=True)
assert r.status_code == 200
csp = r.headers.g... | csp | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_static_csp.py | test_html_no_cdn_scripts | assert | variable | 12 | import pytest
pytestmark = [pytest.mark.e2e]
class TestNoCDNReferences:
@pytest.mark.parametrize("path", ["/", "/settings", "/help", "/client-certificates"])
def test_html_no_cdn_scripts(self, api, path):
r = api.get(path, allow_redirects=True)
body = r.text
assert "cdn.tailwindcss.c... | body | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
fabriziosalmi/certmate | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | train | train | tests/test_ui.py | test_no_console_errors | assert | numeric_literal | 35 | import os
import pytest
pytest.importorskip("playwright")
from playwright.sync_api import Page, expect
pytestmark = [pytest.mark.e2e, pytest.mark.ui]
BASE_URL = f"http://localhost:{os.environ.get('CERTMATE_TEST_PORT', '18888')}"
def browser_page(docker_container):
"""Provide a Playwright browser page."""
f... | 0 | 4b703cff290441da359de12e0e994b8bd9d94b54 | 23 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | dataset_generation/tests/test_episode_generator.py | test_llm_rearrange_episode_generator | assert | numeric_literal | 175 | import gc
from copy import deepcopy
from os import path as osp
import pytest
from dataset_generation.benchmark_generation.generate_episodes import (
default_gen_config,
generate_episode,
get_generator_state_semantic_debug_info,
initialize_generator,
)
from habitat_llm.agent.env.dataset import Collabor... | 0 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | dataset_generation/tests/test_episode_generator.py | test_llm_rearrange_episode_generator | assert | none_literal | 210 | import gc
from copy import deepcopy
from os import path as osp
import pytest
from dataset_generation.benchmark_generation.generate_episodes import (
default_gen_config,
generate_episode,
get_generator_state_semantic_debug_info,
initialize_generator,
)
from habitat_llm.agent.env.dataset import Collabor... | None | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | dataset_generation/tests/test_episode_generator.py | test_llm_rearrange_episode_generator | assert | complex_expr | 215 | import gc
from copy import deepcopy
from os import path as osp
import pytest
from dataset_generation.benchmark_generation.generate_episodes import (
default_gen_config,
generate_episode,
get_generator_state_semantic_debug_info,
initialize_generator,
)
from habitat_llm.agent.env.dataset import Collabor... | ep.info | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | dataset_generation/tests/test_evaluation_generator.py | test_spatial_temporal_heuristic | assert | variable | 104 | from typing import List
import pytest
from dataset_generation.benchmark_generation.evaluation_generation.heuristics import (
spatial_temporal_correction_heuristic,
)
from dataset_generation.benchmark_generation.evaluation_generation.parsing import (
TemporalParser,
)
from habitat_llm.agent.env.evaluation.eval... | expected_groups | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_cg_graph.py | test_reading_cg | assert | string_literal | 48 | import json
from habitat_llm.world_model import DynamicWorldGraph, Object
world_model_path = "data/hssd-partnr-ci/conceptgraph/test_cg_data.json"
def test_reading_cg():
with open(world_model_path, "r") as f:
sg_dict_list = json.load(f)
mygraph = DynamicWorldGraph()
mygraph.create_cg_edges(sg_dic... | "object" | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_constrained_generation.py | test_grammar_generation | assert | variable | 117 | import gc
import pytest
from transformers_cfg.parser import parse_ebnf
from transformers_cfg.recognizer import StringRecognizer
from habitat_llm.agent.env.dataset import CollaborationDatasetV0
from habitat_llm.evaluation.decentralized_evaluation_runner import (
DecentralizedEvaluationRunner,
)
from habitat_llm.te... | grammar_str | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | test_collaboration_dataset | assert | numeric_literal | 63 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | 0 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | test_collaboration_dataset | assert | string_literal | 64 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | "" | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | check_binary_serialization | assert | variable | 43 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | bin_dict | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | check_binary_serialization | assert | variable | 44 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | dataset_decoded_bin | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | check_json_serialization | assert | func_call | 19 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | len(dataset.episodes) | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | check_json_serialization | assert | func_call | 25 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | json.loads( json_str ) | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_dataset.py | check_binary_serialization | assert | func_call | 47 | import json
import time
import pytest
from habitat import logger
from hydra import compose, initialize
from habitat_llm.agent.env import register_sensors # noqa
from habitat_llm.agent.env.dataset import CollaborationDatasetV0, CollaborationEpisode
def check_json_serialization(dataset: CollaborationDatasetV0):
s... | json.loads( dataset.to_json() ) | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_evaluation_constraints | assert | numeric_literal | 159 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | 4 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_evaluation_constraints | assert | numeric_literal | 160 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | 5 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_evaluation_explanation | assert | string_literal | 189 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | "" | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_evaluation_constraints | assert | variable | 101 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | TTT | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_evaluation_constraints | assert | variable | 102 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | TFT | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_compute_percent_complete | assert | numeric_literal | 70 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | 1.0 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_compute_percent_complete | assert | numeric_literal | 71 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | 0.5 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_compute_percent_complete | assert | numeric_literal | 72 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | 0.0 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_compute_percent_complete | assert | numeric_literal | 73 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | 0.75 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_sim_predicates | assert | variable | 167 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | expected | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_sim_predicates | assert | string_literal | 80 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | "102817140" | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_proposition_dependencies_any_mode | assert | variable | 109 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | expected_result | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_evaluation_explanation | assert | variable | 190 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | explanation_str | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_evaluation.py | test_proposition_dependencies | assert | complex_expr | 106 | import itertools
import os
from copy import deepcopy
from typing import List
import habitat
import numpy as np
import pytest
from habitat.sims.habitat_simulator import sim_utilities
from habitat.sims.habitat_simulator.object_state_machine import set_state_of_obj
from hydra import compose, initialize
from habitat_llm.... | expected_result[relation] | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_remove_all_edges | assert | numeric_literal | 18 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_remove_all_edges():
graph = Graph()
with pytest.raises(ValueError) as e:
graph.remove_all_edges("test")
assert "test not present in the graph" in str(e.value)
test_nodes = [... | 5 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_remove_all_edges | assert | numeric_literal | 19 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_remove_all_edges():
graph = Graph()
with pytest.raises(ValueError) as e:
graph.remove_all_edges("test")
assert "test not present in the graph" in str(e.value)
test_nodes = [... | 1 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_get_neighbors | assert | collection | 34 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_get_neighbors():
graph = Graph()
# make sure error is raised if node is not present
with pytest.raises(ValueError) as e:
graph.get_neighbors("test")
assert "test not presen... | {} | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_get_node_from_name | assert | variable | 15 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_get_node_from_name():
graph = Graph()
with pytest.raises(ValueError) as e:
graph.get_node_from_name("test")
assert "Node with name test not present" in str(e.value)
test_no... | test_node | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_get_node_from_name | pytest.raises | variable | 9 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_get_node_from_name():
graph = Graph()
with pytest.raises( | ValueError) | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_get_node_from_name | assert | func_call | 11 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_get_node_from_name():
graph = Graph()
with pytest.raises(ValueError) as e:
graph.get_node_from_name("test")
assert "Node with name test not present" in | str(e.value) | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_graph.py | test_get_neighbors | assert | collection | 28 | import pytest
from habitat_llm.world_model.entity import Entity
from habitat_llm.world_model.graph import Graph
def test_get_neighbors():
graph = Graph()
# make sure error is raised if node is not present
with pytest.raises(ValueError) as e:
graph.get_neighbors("test")
assert "test not presen... | {test_nodes[0]: "test_edge"} | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_metadata_interface.py | test_ovmm_source_objects | assert | numeric_literal | 52 | from os import path as osp
import habitat.datasets.rearrange.samplers.receptacle as hab_receptacle
import habitat.sims.habitat_simulator.sim_utilities as sutils
import pytest
from habitat_sim import Simulator
from habitat_sim.metadata import MetadataMediator
from habitat_sim.utils.settings import default_sim_settings,... | 0 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_metadata_interface.py | test_metadata_interface | assert | none_literal | 40 | from os import path as osp
import habitat.datasets.rearrange.samplers.receptacle as hab_receptacle
import habitat.sims.habitat_simulator.sim_utilities as sutils
import pytest
from habitat_sim import Simulator
from habitat_sim.metadata import MetadataMediator
from habitat_sim.utils.settings import default_sim_settings,... | None | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
facebookresearch/partnr-planner | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | train | train | habitat_llm/tests/test_planner.py | test_oracle_planner_teleport | assert | numeric_literal | 142 | import copy
import gc
import os
from typing import Dict
from unittest.mock import Mock
import pytest
from hydra import compose, initialize
from hydra.core.hydra_config import HydraConfig
from hydra.utils import instantiate
from omegaconf import open_dict
from torch import multiprocessing as mp
from habitat_llm.agent.... | 8 | e13f82a2fb361c1067b80a280496440c7498e9da | 0 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.