repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
rcmdnk/homebrew-file | from __future__ import annotations
import io
import logging
import os
from pathlib import Path
import pytest
from .brew_file import (
BrewFile,
BrewHelper,
BrewInfo,
CmdError,
__prog__,
is_mac,
)
def bf() -> BrewFile:
return BrewFile({})
def test_set_args(bf: BrewFile) -> None:
bf.o... | 1 | assert | numeric_literal | tests/test_brew_file.py | test_set_args | 106 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
from pathlib import Path
import pytest
from . import brew_file
def test_error_handling(tmp_path: Path) -> None:
test_file = tmp_path / 'test.txt'
# Test handling of write error
Path(tmp_path).chmod(0o444) # Make directory read-only
with pytest.raises( | PermissionError) | pytest.raises | variable | tests/test_open_wrapper.py | test_error_handling | 54 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
from pathlib import Path
import pytest
from . import brew_file
def test_open_with_different_modes(tmp_path: Path) -> None:
test_file = tmp_path / 'test.txt'
# Test write mode
with brew_file.OpenWrapper(test_file, 'w') as f:
f.write('test')
# Test read mod... | 'test' | assert | string_literal | tests/test_open_wrapper.py | test_open_with_different_modes | 41 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
from pathlib import Path
import pytest
from . import brew_file
def test_open_existing_file(tmp_path: Path) -> None:
# Create file first
test_file = tmp_path / 'test.txt'
content = 'initial content'
test_file.write_text(content)
# Test writing to existing file
... | new_content | assert | variable | tests/test_open_wrapper.py | test_open_existing_file | 29 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
from pathlib import Path
import pytest
from .brew_file import BrewHelper, BrewInfo, is_mac
def test_desc_disabled(brew_info: BrewInfo) -> None:
brew_info.helper.opt['describe'] = False
assert brew_info.desc_comment('python', 'formulae') == | '' | assert | string_literal | tests/test_brew_info.py | test_desc_disabled | 333 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
import platform
import sys
from pathlib import Path
import pytest
from .brew_file import (
LogFormatter,
expandpath,
home_tilde,
is_mac,
shell_envs,
to_bool,
to_num,
)
def test_log_formatter() -> None:
formatter = LogFormatt... | formatted | assert | variable | tests/test_utils.py | test_log_formatter | 43 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
from pathlib import Path
import pytest
from .brew_file import BrewHelper, BrewInfo, is_mac
def test_clear_input(brew_info: BrewInfo) -> None:
brew_info.brew_opt_input.update({'abc': 'abc'})
brew_info.brew_input.extend(['abc', 'efg'])
brew_info.tap_input.extend(['abc', ... | {} | assert | collection | tests/test_brew_info.py | test_clear_input | 40 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import io
import logging
import os
from pathlib import Path
import pytest
from .brew_file import (
BrewFile,
BrewHelper,
BrewInfo,
CmdError,
__prog__,
is_mac,
)
def bf() -> BrewFile:
return BrewFile({})
def test_user_name(bf: BrewFile) -> None:
bf.... | 'abc' | assert | string_literal | tests/test_brew_file.py | test_user_name | 222 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import io
import logging
import os
from pathlib import Path
import pytest
from .brew_file import (
BrewFile,
BrewHelper,
BrewInfo,
CmdError,
__prog__,
is_mac,
)
def bf() -> BrewFile:
return BrewFile({})
@pytest.mark.parametrize(
('input_value', 're... | out | assert | variable | tests/test_brew_file.py | test_ask_yn | 152 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import io
import logging
import os
from pathlib import Path
import pytest
from .brew_file import (
BrewFile,
BrewHelper,
BrewInfo,
CmdError,
__prog__,
is_mac,
)
def bf() -> BrewFile:
return BrewFile({})
def test_repo_name(bf: BrewFile) -> None:
bf.... | 'def' | assert | string_literal | tests/test_brew_file.py | test_repo_name | 215 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import importlib
import re
from pathlib import Path
from types import ModuleType
from .brew_file import BrewHelper, __version__
def test_version() -> None:
# Check if version in pyproject.toml matches the version in __version__
try:
tomllib: ModuleType = importlib.i... | __version__ | assert | variable | tests/test_version.py | test_version | 19 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import io
import logging
import os
from pathlib import Path
import pytest
from .brew_file import (
BrewFile,
BrewHelper,
BrewInfo,
CmdError,
__prog__,
is_mac,
)
def bf() -> BrewFile:
return BrewFile({})
def test_read(bf: BrewFile, tmp_path: Path) -> No... | None | assert | none_literal | tests/test_brew_file.py | test_read | 170 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
from pathlib import Path
from typing import Any
import pytest
from .brew_file import BrewFile, BrewHelper, BrewInfo, is_mac
pytestmark = pytest.mark.destructive
def clean(request: pytest.FixtureRequest) -> None:
if getattr(request.config, 'destructive... | (0, []) | assert | collection | tests/test_destructive.py | test_clean_script | 75 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
from pathlib import Path
from typing import Any
import pytest
from .brew_file import BrewFile, BrewHelper, BrewInfo, is_mac
pytestmark = pytest.mark.destructive
def clean(request: pytest.FixtureRequest) -> None:
if getattr(request.config, 'destructive... | 'git' | assert | string_literal | tests/test_destructive.py | test_get_full_name | 122 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
import platform
import sys
from pathlib import Path
import pytest
from .brew_file import (
LogFormatter,
expandpath,
home_tilde,
is_mac,
shell_envs,
to_bool,
to_num,
)
def test_log_formatter() -> None:
formatter = LogFormatt... | 'test message' | assert | string_literal | tests/test_utils.py | test_log_formatter | 28 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
import platform
import sys
from pathlib import Path
import pytest
from .brew_file import (
LogFormatter,
expandpath,
home_tilde,
is_mac,
shell_envs,
to_bool,
to_num,
)
def test_home_tilde() -> None:
assert ( | '~/test/path' | assert | string_literal | tests/test_utils.py | test_home_tilde | 115 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
import platform
import sys
from pathlib import Path
import pytest
from .brew_file import (
LogFormatter,
expandpath,
home_tilde,
is_mac,
shell_envs,
to_bool,
to_num,
)
def test_is_mac(monkeypatch: pytest.MonkeyPatch) -> None:
... | bool(is_mac()) | assert | func_call | tests/test_utils.py | test_is_mac | 47 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
from pathlib import Path
import pytest
from . import brew_file
def test_open_non_existing_file(tmp_path: Path) -> None:
# Test creating a new file
content = 'abc\nxyz'
with brew_file.OpenWrapper(tmp_path / 'more/path/file') as f:
f.write(content)
with Path(... | content | assert | variable | tests/test_open_wrapper.py | test_open_non_existing_file | 16 | null | |
rcmdnk/homebrew-file | from __future__ import annotations
import logging
import os
from pathlib import Path
from typing import Any
import pytest
from .brew_file import BrewFile, BrewHelper, BrewInfo, is_mac
pytestmark = pytest.mark.destructive
def clean(request: pytest.FixtureRequest) -> None:
if getattr(request.config, 'destructive... | content | assert | variable | tests/test_destructive.py | test_main_file_inheritance | 1,267 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | "red" | assert | string_literal | tests/test_builder.py | test_read_options | 76 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_base_option():
line = "@(layout=split, default_h1=true, custom_key=value)"
base_option = PageOption(
layout="content", default_h1=False, default_h2=True, default_h3=True
)
updated_option = parse_deco(line, ba... | True | assert | bool_literal | tests/test_parse_deco.py | test_deco_with_base_option | 34 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_computed_slide_size():
page_option = PageOption()
assert page_option.computed_slide_size == | (720, 405) | assert | collection | tests/test_parse_deco.py | test_computed_slide_size | 80 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_type_conversion():
line = "@(default_h1=true, default_h2=false, layout=centered, custom_int=42, custom_float=3.14)"
base_option = PageOption()
updated_option = parse_deco(line, base_option)
assert updated_option.sty... | False | assert | bool_literal | tests/test_parse_deco.py | test_deco_with_type_conversion | 46 | null | |
wbopan/moffee | from email.utils import unquote
import os
import pytest
import shutil
import tempfile
from urllib.parse import quote
from moffee.utils.file_helper import (
copy_assets,
)
def setup_test_environment():
temp_dir = tempfile.mkdtemp()
sample_image_path = os.path.join(temp_dir, "sample.png")
sample_pdf_pa... | 2 | assert | numeric_literal | tests/test_copy_assets.py | test_copy_assets_updates_links | 73 | null | |
wbopan/moffee | from email.utils import unquote
import os
import pytest
import shutil
import tempfile
from urllib.parse import quote
from moffee.utils.file_helper import (
copy_assets,
)
def setup_test_environment():
temp_dir = tempfile.mkdtemp()
sample_image_path = os.path.join(temp_dir, "sample.png")
sample_pdf_pa... | 1 | assert | numeric_literal | tests/test_copy_assets.py | test_copy_assets_ignores_urls_in_text_content | 170 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_basic_deco():
line = "@(layout=split, background=blue)"
option = parse_deco(line)
assert option.layout == | "split" | assert | string_literal | tests/test_parse_deco.py | test_basic_deco | 9 | null | |
wbopan/moffee | import pytest
from moffee.utils.md_helper import (
is_comment,
is_empty,
get_header_level,
is_divider,
contains_image,
contains_deco,
extract_title,
rm_comments,
)
def test_is_comment():
assert is_comment("<!-- This is a comment -->") is | True | assert | bool_literal | tests/test_md_helper.py | test_is_comment | 15 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | 1 | assert | numeric_literal | tests/test_builder.py | test_rendering | 65 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_computed_slide_size():
page_option = PageOption()
assert page_option.computed_slide_size == (720, 405)
page_option = PageOption(slide_width=1280)
assert page_option.computed_slide_size == (1280, 405)
page_option = PageOp... | (720, 540) | assert | collection | tests/test_parse_deco.py | test_computed_slide_size | 86 | null | |
wbopan/moffee | import pytest
from moffee.utils.md_helper import (
is_comment,
is_empty,
get_header_level,
is_divider,
contains_image,
contains_deco,
extract_title,
rm_comments,
)
def test_get_header_level():
assert get_header_level("# Header 1") == | 1 | assert | numeric_literal | tests/test_md_helper.py | test_get_header_level | 26 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_invalid_deco():
line = "This is not a deco"
with pytest.raises( | ValueError) | pytest.raises | variable | tests/test_parse_deco.py | test_invalid_deco | 21 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | True | assert | bool_literal | tests/test_builder.py | test_read_options | 74 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | 7 | assert | numeric_literal | tests/test_builder.py | test_rendering | 64 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | 5 | assert | numeric_literal | tests/test_builder.py | test_rendering | 63 | null | |
wbopan/moffee | import pytest
from moffee.compositor import composite, Direction, Type
def sample_document():
return """
---
background-color: gray
layout: split
default_h1: true
default_h2: false
---
# Main Title
## Subtitle
Content of the first slide.
---
@(background-color=yellow)
## Second Slide
- Bullet point 1
- Bullet ... | 1 | assert | numeric_literal | tests/test_paginate.py | test_paginate_creates_correct_number_of_pages | 59 | null | |
wbopan/moffee | import pytest
from moffee.compositor import composite, Direction, Type
def sample_document():
return """
---
background-color: gray
layout: split
default_h1: true
default_h2: false
---
# Main Title
## Subtitle
Content of the first slide.
---
@(background-color=yellow)
## Second Slide
- Bullet point 1
- Bullet ... | {} | assert | collection | tests/test_paginate.py | test_empty_lines_handling | 263 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_computed_slide_size():
page_option = PageOption()
assert page_option.computed_slide_size == (720, 405)
page_option = PageOption(slide_width=1280)
assert page_option.computed_slide_size == (1280, 405)
page_option = PageOp... | (1024, 768) | assert | collection | tests/test_parse_deco.py | test_computed_slide_size | 92 | null | |
wbopan/moffee | import pytest
from moffee.compositor import composite, Direction, Type
def sample_document():
return """
---
background-color: gray
layout: split
default_h1: true
default_h2: false
---
# Main Title
## Subtitle
Content of the first slide.
---
@(background-color=yellow)
## Second Slide
- Bullet point 1
- Bullet ... | 0 | assert | numeric_literal | tests/test_paginate.py | test_escaped_area_chunking | 148 | null | |
wbopan/moffee | import pytest
from moffee.utils.md_helper import (
is_comment,
is_empty,
get_header_level,
is_divider,
contains_image,
contains_deco,
extract_title,
rm_comments,
)
def test_extract_title():
assert extract_title("# Main Title\nSome content") == "Main Title"
assert extract_title("... | None | assert | none_literal | tests/test_md_helper.py | test_extract_title | 80 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | [ {"level": 1, "content": "Title", "page_ids": [0, 1, 2, 3]}, {"level": 2, "content": "Heading1", "page_ids": [1, 2]}, {"level": 3, "content": "Subheading1", "page_ids": [2]}, {"level": 2, "content": "Heading2", "page_ids": [3]}, {"level": 3, "content": "Subheading1", "page_ids": [3]}, {"level": 1, "content": "Title2",... | assert | collection | tests/test_builder.py | test_retrieve_structure | 121 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | "beam" | assert | string_literal | tests/test_builder.py | test_read_options | 75 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | [ {"h1": "Title", "h2": None, "h3": None}, {"h1": "Title", "h2": "Heading1", "h3": None}, {"h1": "Title", "h2": "Heading1", "h3": "Subheading1"}, {"h1": "Title", "h2": "Heading2", "h3": "Subheading1"}, {"h1": "Title2", "h2": None, "h3": None}, ] | assert | collection | tests/test_builder.py | test_retrieve_structure | 130 | null | |
wbopan/moffee | from urllib.parse import quote
import pytest
import tempfile
import os
from moffee.utils.file_helper import redirect_paths
def setup_test_env():
with tempfile.TemporaryDirectory() as temp_dir:
# Setup test files and directories
doc_path = os.path.join(temp_dir, "test.md")
res_dir = os.path.... | redirected_document | assert | variable | tests/test_redirect_paths.py | test_redirect_paths | 58 | null | |
wbopan/moffee | import os
import tempfile
import pytest
import re
from moffee.builder import build, render_jinja2, read_options, retrieve_structure
from moffee.compositor import composite
def template_dir(name="base"):
return os.path.join(os.path.dirname(__file__), "..", "moffee", "templates", name)
def setup_test_env():
doc... | "resources" | assert | string_literal | tests/test_builder.py | test_read_options | 77 | null | |
wbopan/moffee | from urllib.parse import quote
import pytest
import tempfile
import os
from moffee.utils.file_helper import redirect_paths
def setup_test_env():
with tempfile.TemporaryDirectory() as temp_dir:
# Setup test files and directories
doc_path = os.path.join(temp_dir, "test.md")
res_dir = os.path.... | document | assert | variable | tests/test_redirect_paths.py | test_redirect_paths_trivial | 104 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_basic_deco():
line = "@(layout=split, background=blue)"
option = parse_deco(line)
assert option.layout == "split"
assert option.styles == | {"background": "blue"} | assert | collection | tests/test_parse_deco.py | test_basic_deco | 10 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_quotes():
line = "@(layout = \"split\",length='34px')"
option = parse_deco(line)
assert option.layout == "split"
assert option.styles == | {"length": "34px"} | assert | collection | tests/test_parse_deco.py | test_deco_with_quotes | 61 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_empty_deco():
line = "@()"
option = parse_deco(line)
assert option == | PageOption() | assert | func_call | tests/test_parse_deco.py | test_empty_deco | 16 | null | |
wbopan/moffee | import pytest
from moffee.utils.md_helper import (
is_comment,
is_empty,
get_header_level,
is_divider,
contains_image,
contains_deco,
extract_title,
rm_comments,
)
def test_get_header_level():
assert get_header_level("# Header 1") == 1
assert get_header_level("### Header 3") == ... | 0 | assert | numeric_literal | tests/test_md_helper.py | test_get_header_level | 28 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_computed_slide_size():
page_option = PageOption()
assert page_option.computed_slide_size == (720, 405)
page_option = PageOption(slide_width=1280)
assert page_option.computed_slide_size == | (1280, 405) | assert | collection | tests/test_parse_deco.py | test_computed_slide_size | 83 | null | |
wbopan/moffee | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_type_conversion():
line = "@(default_h1=true, default_h2=false, layout=centered, custom_int=42, custom_float=3.14)"
base_option = PageOption()
updated_option = parse_deco(line, base_option)
assert updated_option.sty... | "centered" | assert | string_literal | tests/test_parse_deco.py | test_deco_with_type_conversion | 47 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from omegaconf import OmegaConf
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.model.yolo import YOLO, create_model
co... | 39 | assert | numeric_literal | tests/test_model/test_yolo.py | test_model_basic_status | 66 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_validation_data_loader_cor... | (5, 5) | assert | collection | tests/test_tools/test_data_loader.py | test_validation_data_loader_correctness | 48 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_training_data_loader_corre... | 2 | assert | numeric_literal | tests/test_tools/test_data_loader.py | test_training_data_loader_correctness | 33 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import torch
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.model.module import SPPELAN, ADown, CBLinear, Conv, Pool
STRIDE = 2
KERNEL_SIZE = 3
IN_CHANNELS = 64
OUT_CHANNELS = 128
NECK_CHANNELS = 64
def test_cblinear():
... | (1, 5, 64, 64) | assert | collection | tests/test_model/test_module.py | test_cblinear | 51 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | (2, 2) | assert | collection | tests/test_utils/test_bounding_box_utils.py | test_calculate_iou_2d | 37 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_create_dataloader_cache(tr... | l_image_paths | assert | variable | tests/test_tools/test_data_loader.py | test_create_dataloader_cache | 27 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import torch
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.model.module import SPPELAN, ADown, CBLinear, Conv, Pool
STRIDE = 2
KERNEL_SIZE = 3
IN_CHANNELS = 64
OUT_CHANNELS = 128
NECK_CHANNELS = 64
def test_adown():
... | (1, OUT_CHANNELS, 32, 32) | assert | collection | tests/test_model/test_module.py | test_adown | 43 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | torch.Size([3, 1, 3, 1, 1, 2]) | assert | func_call | tests/test_utils/test_bounding_box_utils.py | test_anc2box_autoanchor | 145 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | (1, 2, 2) | assert | collection | tests/test_utils/test_bounding_box_utils.py | test_calculate_iou_3d | 45 | null | |
MultimediaTechLab/YOLO | import os
import shutil
import sys
from pathlib import Path
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.dataset_preparation import prepare_dataset, prepare_weight
def test_prepare_dataset(train_cfg: Config):
... | os.listdir(annotations_path) | assert | func_call | tests/test_tools/test_dataset_preparation.py | test_prepare_dataset | 25 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import torch
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.model.module import SPPELAN, ADown, CBLinear, Conv, Pool
STRIDE = 2
KERNEL_SIZE = 3
IN_CHANNELS = 64
OUT_CHANNELS = 128
NECK_CHANNELS = 64
def test_pool_max():
... | (1, IN_CHANNELS, 32, 32) | assert | collection | tests/test_model/test_module.py | test_pool_max | 29 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_validation_data_loader_cor... | 5 | assert | numeric_literal | tests/test_tools/test_data_loader.py | test_validation_data_loader_correctness | 45 | null | |
MultimediaTechLab/YOLO | import sys
from math import isclose
from pathlib import Path
import pytest
from lightning.pytorch import Trainer
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.model.yolo import YO... | None | assert | none_literal | tests/test_tools/test_solver.py | test_model_trainer_initialization | 78 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | [8, 16, 32] | assert | collection | tests/test_utils/test_bounding_box_utils.py | test_vec2box_autoanchor | 123 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | [ torch.Size([1, 1, 80, 40, 2]), torch.Size([1, 1, 40, 20, 2]), torch.Size([1, 1, 20, 10, 2]), ] | assert | collection | tests/test_utils/test_bounding_box_utils.py | test_anc2box_autoanchor | 140 | null | |
MultimediaTechLab/YOLO | import re
import sys
from pathlib import Path
import pytest
from torch import nn
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.utils.module_utils import (
auto_pad,
create_activation_function,
divide_into_chunks,
)
def test_get_activation_invali... | ValueError) | pytest.raises | variable | tests/test_utils/test_module_utils.py | test_get_activation_invalid | 41 | null | |
MultimediaTechLab/YOLO | import re
import sys
from pathlib import Path
import pytest
from torch import nn
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.utils.module_utils import (
auto_pad,
create_activation_function,
divide_into_chunks,
)
@pytest.mark.parametrize(
... | expected | assert | variable | tests/test_utils/test_module_utils.py | test_auto_pad | 28 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import torch
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.model.module import SPPELAN, ADown, CBLinear, Conv, Pool
STRIDE = 2
KERNEL_SIZE = 3
IN_CHANNELS = 64
OUT_CHANNELS = 128
NECK_CHANNELS = 64
def test_cblinear():
... | 2 | assert | numeric_literal | tests/test_model/test_module.py | test_cblinear | 50 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | ValueError, match="Invalid input or output format") | pytest.raises | complex_expr | tests/test_utils/test_bounding_box_utils.py | test_transform_bbox_invalid_format | 101 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | (4200, 2) | assert | collection | tests/test_utils/test_bounding_box_utils.py | test_vec2box_autoanchor | 126 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_file_stream_data_loader_fr... | (1, 3, 640, 640) | assert | collection | tests/test_tools/test_data_loader.py | test_file_stream_data_loader_frame | 62 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | scalers.shape[0] | assert | complex_expr | tests/test_utils/test_bounding_box_utils.py | test_generate_anchors | 113 | null | |
MultimediaTechLab/YOLO | import sys
from math import isinf, isnan
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.model.yolo import create_model
from yolo.t... | 0 | assert | numeric_literal | tests/test_tools/test_loss_functions.py | test_yolo_loss | 54 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_validation_data_loader_cor... | (5, 3, 640, 640) | assert | collection | tests/test_tools/test_data_loader.py | test_validation_data_loader_correctness | 46 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_file_stream_data_loader_fr... | (1024, 768) | assert | collection | tests/test_tools/test_data_loader.py | test_file_stream_data_loader_frame | 64 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import torch
from PIL import Image
from torchvision.transforms import functional as TF
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.tools.data_augmentation import (
AugmentationComposer,
HorizontalFlip,
Mosai... | flipped_img | assert | variable | tests/test_tools/test_data_augmentation.py | test_horizontal_flip | 28 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from omegaconf import OmegaConf
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.model.yolo import YOLO, create_model
co... | 106 | assert | numeric_literal | tests/test_model/test_yolo.py | test_build_model_v7 | 46 | null | |
MultimediaTechLab/YOLO | import os
import shutil
import sys
from pathlib import Path
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.dataset_preparation import prepare_dataset, prepare_weight
def test_prepare_dataset(train_cfg: Config):
... | 5 | assert | numeric_literal | tests/test_tools/test_dataset_preparation.py | test_prepare_dataset | 22 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import torch
from PIL import Image
from torchvision.transforms import functional as TF
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.tools.data_augmentation import (
AugmentationComposer,
HorizontalFlip,
Mosai... | (100, 100) | assert | collection | tests/test_tools/test_data_augmentation.py | test_mosaic | 70 | null | |
MultimediaTechLab/YOLO | import re
import sys
from pathlib import Path
import pytest
from torch import nn
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.utils.module_utils import (
auto_pad,
create_activation_function,
divide_into_chunks,
)
def test_divide_into_chunks_no... | ValueError, match=re.escape("The length of the input list (6) must be exactly divisible by the number of chunks (4).")) | pytest.raises | func_call | tests/test_utils/test_module_utils.py | test_divide_into_chunks_non_divisible_length | 55 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from omegaconf import OmegaConf
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.model.yolo import YOLO, create_model
co... | [ (torch.Size([2, 80, 80, 80]), torch.Size([2, 16, 4, 80, 80]), torch.Size([2, 4, 80, 80])), (torch.Size([2, 80, 40, 40]), torch.Size([2, 16, 4, 40, 40]), torch.Size([2, 4, 40, 40])), (torch.Size([2, 80, 20, 20]), torch.Size([2, 16, 4, 20, 20]), torch.Size([2, 4, 20, 20])), ] | assert | collection | tests/test_model/test_yolo.py | test_yolo_forward_output_shape | 77 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_directory_stream_data_load... | (640, 640) | assert | collection | tests/test_tools/test_data_loader.py | test_directory_stream_data_loader_frame | 72 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
from torch.utils.data import DataLoader
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.tools.data_loader import StreamDataLoader, create_dataloader
def test_validation_data_loader_cor... | (5, 18, 5) | assert | collection | tests/test_tools/test_data_loader.py | test_validation_data_loader_correctness | 47 | null | |
MultimediaTechLab/YOLO | import re
import sys
from pathlib import Path
import pytest
from torch import nn
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.utils.module_utils import (
auto_pad,
create_activation_function,
divide_into_chunks,
)
def test_divide_into_chunks():... | expected_output | assert | variable | tests/test_utils/test_module_utils.py | test_divide_into_chunks | 49 | null | |
MultimediaTechLab/YOLO | import sys
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
from torch import allclose, float32, isclose, tensor
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo import Config, NMSConfig, create_model
from yolo.config.co... | 2 | assert | numeric_literal | tests/test_utils/test_bounding_box_utils.py | test_generate_anchors | 114 | null | |
MultimediaTechLab/YOLO | import sys
from math import isinf, isnan
from pathlib import Path
import pytest
import torch
from hydra import compose, initialize
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))
from yolo.config.config import Config
from yolo.model.yolo import create_model
from yolo.t... | 2e5 | assert | numeric_literal | tests/test_tools/test_loss_functions.py | test_yolo_loss | 56 | null | |
manzt/anywidget | import pathlib
import time
import weakref
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, ClassVar, Generator, Set, Union
from unittest.mock import MagicMock, patch
import anywidget._descriptor
import pytest
import watchfiles
from anywidget._descriptor import (
_COMMS,
MimeBundleD... | repr_ | assert | variable | tests/test_descriptor.py | test_descriptor | 110 | null | |
manzt/anywidget | import pathlib
import time
import weakref
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, ClassVar, Generator, Set, Union
from unittest.mock import MagicMock, patch
import anywidget._descriptor
import pytest
import watchfiles
from anywidget._descriptor import (
_COMMS,
MimeBundleD... | esm.read_text() | assert | func_call | tests/test_descriptor.py | test_infer_file_contents | 346 | null | |
manzt/anywidget | import pathlib
import time
from collections import deque
from typing import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
import watchfiles
from anywidget._file_contents import FileContents, VirtualFileContents
from watchfiles import Change
def test_file_contents_thread(tmp_path: pathlib.Pa... | None | assert | none_literal | tests/test_file_contents.py | test_file_contents_thread | 94 | null | |
manzt/anywidget | import pathlib
import time
import weakref
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, ClassVar, Generator, Set, Union
from unittest.mock import MagicMock, patch
import anywidget._descriptor
import pytest
import watchfiles
from anywidget._descriptor import (
_COMMS,
MimeBundleD... | {"value": b"hello"}) | assert_* | collection | tests/test_descriptor.py | test_state_setter_binary | 156 | null | |
manzt/anywidget | import pathlib
import time
from collections import deque
from typing import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
import watchfiles
from anywidget._file_contents import FileContents, VirtualFileContents
from watchfiles import Change
def test_file_contents_changed(tmp_path: pathlib.P... | new_contents) | assert_* | variable | tests/test_file_contents.py | test_file_contents_changed | 70 | null | |
manzt/anywidget | import pathlib
import time
from collections import deque
from typing import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
import watchfiles
from anywidget._file_contents import FileContents, VirtualFileContents
from watchfiles import Change
def test_missing_file_fails() -> None:
"""Test... | ValueError, match="does not exist") | pytest.raises | complex_expr | tests/test_file_contents.py | test_missing_file_fails | 139 | null | |
manzt/anywidget | from __future__ import annotations
import json
import pathlib
import sys
import time
from typing import Generator, NoReturn
from unittest.mock import MagicMock, patch
import anywidget
import pytest
import traitlets.traitlets as t
import watchfiles
from anywidget._file_contents import FileContents
from anywidget._util... | None | assert | none_literal | tests/test_widget.py | test_infer_file_contents | 173 | null | |
manzt/anywidget | import pathlib
import time
from collections import deque
from typing import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
import watchfiles
from anywidget._file_contents import FileContents, VirtualFileContents
from watchfiles import Change
def test_file_contents_deleted(tmp_path: pathlib.P... | path) | assert_* | variable | tests/test_file_contents.py | test_file_contents_deleted | 46 | null | |
manzt/anywidget | from __future__ import annotations
import json
import pathlib
import sys
import time
from typing import Generator, NoReturn
from unittest.mock import MagicMock, patch
import anywidget
import pytest
import traitlets.traitlets as t
import watchfiles
from anywidget._file_contents import FileContents
from anywidget._util... | esm | assert | variable | tests/test_widget.py | test_basic | 48 | null | |
manzt/anywidget | import pathlib
import time
import weakref
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, ClassVar, Generator, Set, Union
from unittest.mock import MagicMock, patch
import anywidget._descriptor
import pytest
import watchfiles
from anywidget._descriptor import (
_COMMS,
MimeBundleD... | 0 | assert | numeric_literal | tests/test_descriptor.py | test_descriptor | 95 | null | |
manzt/anywidget | import pathlib
import time
import weakref
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, ClassVar, Generator, Set, Union
from unittest.mock import MagicMock, patch
import anywidget._descriptor
import pytest
import watchfiles
from anywidget._descriptor import (
_COMMS,
MimeBundleD... | RuntimeError) | pytest.raises | variable | tests/test_descriptor.py | test_comm_cleanup | 182 | null | |
manzt/anywidget | from __future__ import annotations
import json
import pathlib
import sys
import time
from typing import Generator, NoReturn
from unittest.mock import MagicMock, patch
import anywidget
import pytest
import traitlets.traitlets as t
import watchfiles
from anywidget._file_contents import FileContents
from anywidget._util... | 1 | assert | numeric_literal | tests/test_widget.py | test_anywidget_commands_register_one_callback | 317 | null | |
manzt/anywidget | import pathlib
import sys
from unittest.mock import MagicMock, patch
import pytest
from anywidget._file_contents import FileContents
from anywidget._util import (
get_repr_metadata,
put_buffers,
remove_buffers,
try_file_contents,
)
from anywidget._version import get_semver_version
def enable_hmr(): #... | None | assert | none_literal | tests/test_utils.py | test_try_file_contents_development | 115 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.