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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_audiobookshelf_client.py | test_upload_fields_include_series_sequence | assert | string_literal | 33 | from __future__ import annotations
import json
from abogen.integrations.audiobookshelf import (
AudiobookshelfClient,
AudiobookshelfConfig,
)
def test_upload_fields_include_series_sequence(tmp_path):
audio_path = tmp_path / "book.mp3"
audio_path.write_bytes(b"audio")
config = AudiobookshelfConfi... | "Example Saga" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_epub_metadata_extraction | self.assertEqual | string_literal | 87 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | "Sample Book") | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_epub_metadata_extraction | self.assertEqual | string_literal | 88 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | "Test Author") | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chapter_overrides.py | test_apply_chapter_overrides_uses_original_content_when_text_missing | assert | string_literal | 121 | from __future__ import annotations
import sys
import types
def _install_dependency_stubs() -> None:
if "ebooklib" not in sys.modules:
ebooklib_stub = types.ModuleType("ebooklib")
epub_stub = types.ModuleType("ebooklib.epub")
setattr(ebooklib_stub, "epub", epub_stub)
sys.modules["eb... | "Original two" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_opds_import_metadata_mapping.py | test_opds_metadata_overrides_maps_author_and_subtitle | assert | string_literal | 26 | from __future__ import annotations
from abogen.webui.routes.api import _opds_metadata_overrides
def test_opds_metadata_overrides_maps_author_and_subtitle() -> None:
overrides = _opds_metadata_overrides(
{
"authors": ["Alexandre Dumas"],
"subtitle": "Unabridged",
"series... | "Summary text" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_opds_import_metadata_mapping.py | test_opds_metadata_overrides_accepts_author_string | assert | string_literal | 8 | from __future__ import annotations
from abogen.webui.routes.api import _opds_metadata_overrides
def test_opds_metadata_overrides_accepts_author_string() -> None:
overrides = _opds_metadata_overrides({"author": "Mary Shelley"})
assert overrides["authors"] == | "Mary Shelley" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_service.py | test_audiobookshelf_metadata_uses_book_number | assert | string_literal | 41 | from __future__ import annotations
import io
import time
from abogen.webui.service import (
Job,
JobStatus,
build_service,
_JOB_LOGGER,
build_audiobookshelf_metadata,
)
def test_audiobookshelf_metadata_uses_book_number(tmp_path):
source = tmp_path / "book.txt"
source.write_text("content", ... | "Example Saga" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_settings_integrations_secrets.py | test_settings_update_preserves_abs_api_token_when_blank | assert | string_literal | 72 | from __future__ import annotations
from pathlib import Path
from abogen.utils import load_config, save_config
from abogen.webui.app import create_app
def test_settings_update_preserves_abs_api_token_when_blank(tmp_path):
# Seed config with stored integration secret.
save_config(
{
"langua... | "SECRET_TOKEN" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_extractor.py | test_epub_series_metadata_extracted_from_opf_meta | assert | string_literal | 52 | from unittest.mock import patch
import pytest
from pathlib import Path
from ebooklib import epub
from abogen.text_extractor import extract_from_path
from abogen.utils import calculate_text_length
def sample_epub_path():
return Path(__file__).parent / "fixtures" / "abogen_debug_tts_samples.epub"
def test_epub_s... | "Example Saga" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_helpers.py | test_chunk_voice_spec_falls_back_to_speaker_voice | assert | string_literal | 15 | from __future__ import annotations
from types import SimpleNamespace
from abogen.chunking import chunk_text
from abogen.webui.conversion_runner import _chunk_voice_spec, _group_chunks_by_chapter
def test_chunk_voice_spec_falls_back_to_speaker_voice() -> None:
job = SimpleNamespace(
voice="base_voice", sp... | "speaker_voice" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_text_for_tts_prefers_raw.py | test_chunk_text_for_tts_falls_back_to_original_text_then_normalized_text | assert | string_literal | 9 | from abogen.webui.conversion_runner import _chunk_text_for_tts
def test_chunk_text_for_tts_falls_back_to_original_text_then_normalized_text():
entry = {
"original_text": "Hello * world",
"normalized_text": "Hello world",
}
assert _chunk_text_for_tts(entry) == | "Hello * world" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_service.py | test_job_add_log_emits_to_stream | assert | string_literal | 55 | from __future__ import annotations
import io
import time
from abogen.webui.service import (
Job,
JobStatus,
build_service,
_JOB_LOGGER,
build_audiobookshelf_metadata,
)
def test_job_add_log_emits_to_stream(tmp_path):
sample = tmp_path / "sample.txt"
sample.write_text("payload", encoding="u... | "Test log line" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_helpers.py | test_chunk_voice_spec_prefers_chunk_overrides | assert | string_literal | 13 | from __future__ import annotations
from types import SimpleNamespace
from abogen.chunking import chunk_text
from abogen.webui.conversion_runner import _chunk_voice_spec, _group_chunks_by_chapter
def test_chunk_voice_spec_prefers_chunk_overrides() -> None:
job = SimpleNamespace(voice="base_voice", speakers={})
... | "override_voice" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_chapter_titles.py | test_normalize_chapter_opening_caps_basic_title | assert | string_literal | 14 | import sys
import types
from abogen.webui.conversion_runner import (
_format_spoken_chapter_title,
_headings_equivalent,
_normalize_chapter_opening_caps,
_strip_duplicate_heading_line,
)
def test_normalize_chapter_opening_caps_basic_title() -> None:
normalized, changed = _normalize_chapter_opening... | "All Caps Title" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_chapter_titles.py | test_normalize_chapter_opening_caps_handles_roman_numerals | assert | string_literal | 14 | import sys
import types
from abogen.webui.conversion_runner import (
_format_spoken_chapter_title,
_headings_equivalent,
_normalize_chapter_opening_caps,
_strip_duplicate_heading_line,
)
def test_normalize_chapter_opening_caps_handles_roman_numerals() -> None:
normalized, changed = _normalize_chap... | "IV. The Return" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_text_for_tts_prefers_raw.py | test_chunk_text_for_tts_falls_back_to_original_text_then_normalized_text | assert | string_literal | 14 | from abogen.webui.conversion_runner import _chunk_text_for_tts
def test_chunk_text_for_tts_falls_back_to_original_text_then_normalized_text():
entry = {
"original_text": "Hello * world",
"normalized_text": "Hello world",
}
assert _chunk_text_for_tts(entry) == "Hello * world"
entry2 = {... | "Only normalized" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_opds_import_metadata_mapping.py | test_opds_metadata_overrides_maps_author_and_subtitle | assert | string_literal | 18 | from __future__ import annotations
from abogen.webui.routes.api import _opds_metadata_overrides
def test_opds_metadata_overrides_maps_author_and_subtitle() -> None:
overrides = _opds_metadata_overrides(
{
"authors": ["Alexandre Dumas"],
"subtitle": "Unabridged",
"series... | "Alexandre Dumas" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_helpers.py | test_chunk_text_display_preserves_whitespace | assert | string_literal | 24 | from __future__ import annotations
from types import SimpleNamespace
from abogen.chunking import chunk_text
from abogen.webui.conversion_runner import _chunk_voice_spec, _group_chunks_by_chapter
def test_chunk_text_display_preserves_whitespace() -> None:
text = "Line one with double spaces.\nSecond line\n\nThi... | "Third paragraph." | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_chapter_titles.py | test_format_spoken_chapter_title_respects_existing_prefix | assert | string_literal | 13 | import sys
import types
from abogen.webui.conversion_runner import (
_format_spoken_chapter_title,
_headings_equivalent,
_normalize_chapter_opening_caps,
_strip_duplicate_heading_line,
)
def test_format_spoken_chapter_title_respects_existing_prefix() -> None:
assert ( | "Chapter 2: Story" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_chapter_titles.py | test_normalize_chapter_opening_caps_respects_acronyms | assert | string_literal | 14 | import sys
import types
from abogen.webui.conversion_runner import (
_format_spoken_chapter_title,
_headings_equivalent,
_normalize_chapter_opening_caps,
_strip_duplicate_heading_line,
)
def test_normalize_chapter_opening_caps_respects_acronyms() -> None:
normalized, changed = _normalize_chapter_o... | "NASA Mission Log" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_step_speaker_provider.py | test_book_step_supertonic_profile_becomes_speaker_reference | assert | string_literal | 78 | from pathlib import Path
from werkzeug.datastructures import MultiDict
from abogen.webui.routes.utils.form import apply_book_step_form
from abogen.webui.service import PendingJob
def _make_pending_job() -> PendingJob:
pending = PendingJob(
id="pending",
original_filename="example.epub",
s... | "speaker:Female HQ" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_chapter_titles.py | test_format_spoken_chapter_title_adds_prefix | assert | string_literal | 13 | import sys
import types
from abogen.webui.conversion_runner import (
_format_spoken_chapter_title,
_headings_equivalent,
_normalize_chapter_opening_caps,
_strip_duplicate_heading_line,
)
def test_format_spoken_chapter_title_adds_prefix() -> None:
assert _format_spoken_chapter_title("1: A Tale", 1... | "Chapter 1. A Tale" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_prepare_form.py | test_apply_prepare_form_accepts_saved_speaker_reference_for_voice | assert | string_literal | 62 | from pathlib import Path
from werkzeug.datastructures import MultiDict
from abogen.webui.routes.utils.form import apply_prepare_form
from abogen.webui.routes.utils.voice import resolve_voice_setting
from abogen.webui.service import PendingJob
def _make_pending_job() -> PendingJob:
return PendingJob(
id="... | "speaker:Female HQ" | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_addresses_explicit | assert | variable | 22 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | res | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_manual_overrides_applied_first.py | test_manual_override_is_applied_even_if_pronunciation_overrides_stale | assert | variable | 19 | from abogen.webui import conversion_runner
def _apply(text: str, job: DummyJob) -> str:
merged = conversion_runner._merge_pronunciation_overrides(job)
rules = conversion_runner._compile_pronunciation_rules(merged)
return conversion_runner._apply_pronunciation_rules(text, rules)
def test_manual_override_is... | out | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_get_chapters | self.assertIn | variable | 95 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | ids) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_html_nav_parsing.py | test_nested_html_nav_parsing | self.assertIn | variable | 96 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubHtmlNavParsing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | ids) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_prepare_form.py | test_apply_prepare_form_accepts_saved_speaker_reference_for_voice | assert | variable | 64 | from pathlib import Path
from werkzeug.datastructures import MultiDict
from abogen.webui.routes.utils.form import apply_prepare_form
from abogen.webui.routes.utils.voice import resolve_voice_setting
from abogen.webui.service import PendingJob
def _make_pending_job() -> PendingJob:
return PendingJob(
id="... | hero | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_ordered_list_handling | self.assertIn | variable | 86 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | text) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_exporter.py | test_build_epub3_package_creates_expected_structure | assert | variable | 81 | from __future__ import annotations
import html
import re
import zipfile
from abogen.epub3.exporter import build_epub3_package
from abogen.text_extractor import ExtractedChapter, ExtractionResult
def _make_sample_extraction() -> ExtractionResult:
return ExtractionResult(
chapters=[
ExtractedCh... | names | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_audiobookshelf_client.py | test_upload_fields_include_series_sequence | assert | variable | 36 | from __future__ import annotations
import json
from abogen.integrations.audiobookshelf import (
AudiobookshelfClient,
AudiobookshelfConfig,
)
def test_upload_fields_include_series_sequence(tmp_path):
audio_path = tmp_path / "book.mp3"
audio_path.write_bytes(b"audio")
config = AudiobookshelfConfi... | fields | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_pdf_parser_content | self.assertIn | variable | 90 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | text1) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chapter_overrides.py | test_merge_metadata_prefers_overrides_and_drops_none_values | assert | variable | 119 | from __future__ import annotations
import sys
import types
def _install_dependency_stubs() -> None:
if "ebooklib" not in sys.modules:
ebooklib_stub = types.ModuleType("ebooklib")
epub_stub = types.ModuleType("ebooklib.epub")
setattr(ebooklib_stub, "epub", epub_stub)
sys.modules["eb... | merged | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_content_slicing.py | test_single_file_multiple_chapters | self.assertIn | variable | 105 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubContentSlicing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | text1) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_content_slicing.py | test_single_file_multiple_chapters | self.assertIn | variable | 110 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubContentSlicing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | text2) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_extractor.py | test_epub_metadata_composer_matches_artist | assert | variable | 22 | from unittest.mock import patch
import pytest
from pathlib import Path
from ebooklib import epub
from abogen.text_extractor import extract_from_path
from abogen.utils import calculate_text_length
def sample_epub_path():
return Path(__file__).parent / "fixtures" / "abogen_debug_tts_samples.epub"
def test_epub_m... | artist | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_normalization.py | test_normalize_roman_titles_skips_when_not_majority | assert | variable | 40 | from __future__ import annotations
import pytest
from unittest.mock import patch
from abogen.kokoro_text_normalization import (
DEFAULT_APOSTROPHE_CONFIG,
normalize_for_pipeline,
normalize_roman_numeral_titles,
)
from abogen.normalization_settings import (
apply_overrides as apply_normalization_overri... | titles | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_normalization.py | test_year_like_numbers_use_common_pronunciation | assert | variable | 39 | from __future__ import annotations
import pytest
from unittest.mock import patch
from abogen.kokoro_text_normalization import (
DEFAULT_APOSTROPHE_CONFIG,
normalize_for_pipeline,
normalize_roman_numeral_titles,
)
from abogen.normalization_settings import (
apply_overrides as apply_normalization_overri... | folded | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_voice_resolution.py | test_chapter_voice_spec_uses_resolved_formula | assert | variable | 32 | from types import SimpleNamespace
from typing import cast
from abogen.constants import VOICES_INTERNAL
from abogen.webui.conversion_runner import (
_chapter_voice_spec,
_chunk_voice_spec,
_collect_required_voice_ids,
)
from abogen.webui.service import Job
def _sample_job(formula: str) -> Job:
return c... | formula | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_debug_samples_have_minimum_per_category | assert | variable | 40 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | minimum | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_exporter.py | test_build_epub3_package_handles_missing_markers | assert | variable | 41 | from __future__ import annotations
import html
import re
import zipfile
from abogen.epub3.exporter import build_epub3_package
from abogen.text_extractor import ExtractedChapter, ExtractionResult
def _make_sample_extraction() -> ExtractionResult:
return ExtractionResult(
chapters=[
ExtractedCh... | nav_doc | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_ncx_parsing.py | test_nested_ncx_parsing | self.assertIn | variable | 98 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, EpubParser
class TestEpubNcxParsing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/... | titles) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_ffmetadata.py | test_render_ffmetadata_includes_chapters | assert | variable | 38 | from __future__ import annotations
from pathlib import Path
from abogen.webui.conversion_runner import _render_ffmetadata, _write_ffmetadata_file
def test_render_ffmetadata_includes_chapters(tmp_path):
metadata = {
"title": "Sample Book",
"artist": "Author Name",
"comment": "Line one\nLin... | content | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_service.py | test_retry_removes_failed_job | assert | variable | 61 | from __future__ import annotations
import io
import time
from abogen.webui.service import (
Job,
JobStatus,
build_service,
_JOB_LOGGER,
build_audiobookshelf_metadata,
)
def test_retry_removes_failed_job(tmp_path):
uploads = tmp_path / "uploads"
outputs = tmp_path / "outputs"
uploads.mk... | job_ids | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_speaker_analysis.py | test_sample_excerpt_includes_context_paragraphs | assert | variable | 36 | from abogen.speaker_analysis import analyze_speakers
def _chapters():
return [
{
"id": "0001",
"index": 0,
"title": "Test",
"text": "",
"enabled": True,
}
]
def _chunk(text: str, idx: int) -> dict:
return {
"id": f"chunk-{... | excerpt | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_normalization.py | test_all_caps_quotes_are_sentence_cased | assert | variable | 39 | from __future__ import annotations
import pytest
from unittest.mock import patch
from abogen.kokoro_text_normalization import (
DEFAULT_APOSTROPHE_CONFIG,
normalize_for_pipeline,
normalize_roman_numeral_titles,
)
from abogen.normalization_settings import (
apply_overrides as apply_normalization_overri... | cleaned | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_voice_formula_resolution.py | test_resolve_voice_formula_without_pipeline_does_not_crash | assert | variable | 12 | from __future__ import annotations
from abogen.webui.conversion_runner import _resolve_voice, _supertonic_voice_from_spec
from abogen.tts_supertonic import DEFAULT_SUPERTONIC_VOICES
def test_resolve_voice_formula_without_pipeline_does_not_crash() -> None:
# This can happen when a previously-saved Kokoro mix formu... | formula | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_debug_epub_contains_all_codes | assert | variable | 30 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | combined | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_settings_debug_route_writes_manifest | assert | variable | 51 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | location | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_ffmetadata.py | test_render_ffmetadata_includes_chapters | assert | variable | 22 | from __future__ import annotations
from pathlib import Path
from abogen.webui.conversion_runner import _render_ffmetadata, _write_ffmetadata_file
def test_render_ffmetadata_includes_chapters(tmp_path):
metadata = {
"title": "Sample Book",
"artist": "Author Name",
"comment": "Line one\nLin... | rendered | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_preview_applies_manual_overrides.py | test_preview_applies_manual_override_before_normalization | assert | variable | 53 | from abogen.webui.routes.utils import preview
def test_preview_applies_manual_override_before_normalization(monkeypatch):
# Don't run real TTS/normalization; just exercise the override stage by
# forcing provider=kokoro and then stubbing normalize_for_pipeline.
monkeypatch.setattr(preview, "get_preview_pi... | captured | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_speaker_analysis.py | test_analyze_speakers_ignores_leading_stopwords | assert | variable | 32 | from abogen.speaker_analysis import analyze_speakers
def _chapters():
return [
{
"id": "0001",
"index": 0,
"title": "Test",
"text": "",
"enabled": True,
}
]
def _chunk(text: str, idx: int) -> dict:
return {
"id": f"chunk-{... | speakers | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_settings_debug_route_writes_manifest | assert | variable | 62 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | filenames | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_html_nav_parsing.py | test_identify_nav_item | self.assertIsNotNone | variable | 86 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubHtmlNavParsing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | nav_item) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_factory_returns_correct_class | self.assertIsInstance | variable | 83 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | PdfParser) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_conversion_series.py | test_title_intro_includes_series_sentence | assert | variable | 18 | import sys
import types
from abogen.webui.conversion_runner import _build_outro_text, _build_title_intro_text
def test_title_intro_includes_series_sentence() -> None:
metadata = {
"title": "Galactic Chronicles",
"author": "Jane Doe",
"series": "Chronicles",
"series_index": "2",
... | intro_text | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_regression_fixes.py | test_footnote_removal | assert | variable | 23 | import pytest
from unittest.mock import patch
from abogen.kokoro_text_normalization import (
normalize_for_pipeline,
DEFAULT_APOSTROPHE_CONFIG,
)
from abogen.normalization_settings import build_apostrophe_config, _SETTINGS_DEFAULTS
def normalize(text, overrides=None):
settings = dict(_SETTINGS_DEFAULTS)
... | normalized | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_normalization.py | test_title_abbreviations_are_expanded | assert | variable | 39 | from __future__ import annotations
import pytest
from unittest.mock import patch
from abogen.kokoro_text_normalization import (
DEFAULT_APOSTROPHE_CONFIG,
normalize_for_pipeline,
normalize_roman_numeral_titles,
)
from abogen.normalization_settings import (
apply_overrides as apply_normalization_overri... | normalized | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_factory_returns_correct_class | self.assertIsInstance | variable | 89 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | EpubParser) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_exporter.py | test_epub3_preserves_original_whitespace | assert | variable | 85 | from __future__ import annotations
import html
import re
import zipfile
from abogen.epub3.exporter import build_epub3_package
from abogen.text_extractor import ExtractedChapter, ExtractionResult
def _make_sample_extraction() -> ExtractionResult:
return ExtractionResult(
chapters=[
ExtractedCh... | chapter_doc | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_utils_cache.py | test_abogen_temp_dir_configures_hf_cache | assert | variable | 49 | import os
import sys
from pathlib import Path
from typing import Iterable
import pytest
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
def clear_utils_cache():
import abogen.utils as utils
getattr(utils.get_user_cache_root, "cache_clear")()
yield
getattr(utils.get_user_cach... | expected_hf | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_handler_regression.py | test_handler_initialization | self.assertTrue | variable | 80 | import unittest
import os
import sys
import shutil
import time
from PyQt6.QtWidgets import QApplication
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.pyqt.book_handler import HandlerDialog
from ebooklib import epub
app = QApplication(sys.argv)
class TestBookHandlerRe... | found_intro) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_missing_file_error_handling.py | test_missing_file_recovery | self.assertTrue | variable | 89 | import unittest
import os
import shutil
import zipfile
import sys
import logging
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubMissingFileErrorHandling(unittest.TestCase):
def setUp(self):... | chap1_found) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_output_paths.py | test_prepare_project_layout_uses_timestamped_folder | assert | variable | 48 | from __future__ import annotations
import time
from pathlib import Path
import pytest
from abogen.webui.conversion_runner import _build_output_path, _prepare_project_layout
from abogen.webui.service import Job
def _sample_job(tmp_path: Path) -> Job:
source = tmp_path / "sample.txt"
source.write_text("exampl... | project_root | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_helpers.py | test_chunk_text_display_preserves_whitespace | assert | variable | 21 | from __future__ import annotations
from types import SimpleNamespace
from abogen.chunking import chunk_text
from abogen.webui.conversion_runner import _chunk_voice_spec, _group_chunks_by_chapter
def test_chunk_text_display_preserves_whitespace() -> None:
text = "Line one with double spaces.\nSecond line\n\nThi... | first_display | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_exporter.py | test_epub3_preserves_original_whitespace | assert | variable | 88 | from __future__ import annotations
import html
import re
import zipfile
from abogen.epub3.exporter import build_epub3_package
from abogen.text_extractor import ExtractedChapter, ExtractionResult
def _make_sample_extraction() -> ExtractionResult:
return ExtractionResult(
chapters=[
ExtractedCh... | chunk_section | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_exporter.py | test_epub3_preserves_original_whitespace | assert | variable | 96 | from __future__ import annotations
import html
import re
import zipfile
from abogen.epub3.exporter import build_epub3_package
from abogen.text_extractor import ExtractedChapter, ExtractionResult
def _make_sample_extraction() -> ExtractionResult:
return ExtractionResult(
chapters=[
ExtractedCh... | original_text | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_standard_nav.py | test_discovery_by_nav_property | self.assertIsNotNone | variable | 81 | import unittest
import os
import shutil
import sys
from ebooklib import epub
import ebooklib
from unittest.mock import MagicMock
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubStandardNav(unittest.TestCase):
def set... | original_nav) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_utils_cache.py | test_abogen_temp_dir_configures_hf_cache | assert | variable | 47 | import os
import sys
from pathlib import Path
from typing import Iterable
import pytest
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
def clear_utils_cache():
import abogen.utils as utils
getattr(utils.get_user_cache_root, "cache_clear")()
yield
getattr(utils.get_user_cach... | expected_root | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_text_extractor.py | test_epub_character_counts_align_with_calculated_total | assert | variable | 21 | from unittest.mock import patch
import pytest
from pathlib import Path
from ebooklib import epub
from abogen.text_extractor import extract_from_path
from abogen.utils import calculate_text_length
def sample_epub_path():
return Path(__file__).parent / "fixtures" / "abogen_debug_tts_samples.epub"
def test_epub_c... | combined_total | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_factory_returns_correct_class | self.assertIsInstance | variable | 86 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | MarkdownParser) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_voice_cache.py | test_ensure_voice_assets_downloads_missing | assert | func_call | 48 | from types import SimpleNamespace
from typing import cast
import pytest
from abogen.constants import VOICES_INTERNAL
from abogen.voice_cache import (
LocalEntryNotFoundError,
_CACHED_VOICES,
ensure_voice_assets,
)
from abogen.webui.conversion_runner import _collect_required_voice_ids
from abogen.webui.ser... | set() | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_regression_fixes.py | test_year_pronunciation | assert | func_call | 22 | import pytest
from unittest.mock import patch
from abogen.kokoro_text_normalization import (
normalize_for_pipeline,
DEFAULT_APOSTROPHE_CONFIG,
)
from abogen.normalization_settings import build_apostrophe_config, _SETTINGS_DEFAULTS
def normalize(text, overrides=None):
settings = dict(_SETTINGS_DEFAULTS)
... | normalized.lower() | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_address_context_window | assert | func_call | 20 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize(text, cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_specific_user_examples | assert | func_call | 18 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("1021", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_specific_user_examples | assert | func_call | 20 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("1925", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_specific_user_examples | assert | func_call | 22 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("3400", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_2000s | assert | func_call | 18 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("2001", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_2000s | assert | func_call | 19 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("2009", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_2000s | assert | func_call | 21 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("2010", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_debug_samples_normalize_smoke | assert | func_call | 48 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | normalized["CUR_001"].lower() | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_debug_samples_normalize_smoke | assert | func_call | 49 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | normalized["NUM_001"].lower() | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_handler_regression.py | test_handler_initialization | self.assertTrue | func_call | 68 | import unittest
import os
import sys
import shutil
import time
from PyQt6.QtWidgets import QApplication
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.pyqt.book_handler import HandlerDialog
from ebooklib import epub
app = QApplication(sys.argv)
class TestBookHandlerRe... | len(dialog.content_texts) > 0) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_debug_tts_samples.py | test_debug_samples_normalize_smoke | assert | func_call | 35 | import json
from pathlib import Path
import numpy as np
import pytest
from abogen.debug_tts_samples import (
DEBUG_TTS_SAMPLES,
MARKER_PREFIX,
MARKER_SUFFIX,
iter_expected_codes,
)
from abogen.kokoro_text_normalization import HAS_NUM2WORDS, normalize_for_pipeline
from abogen.normalization_settings imp... | normalized["APOS_001"].lower() | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_ambiguous_numbers | assert | func_call | 18 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("I have 1950 apples.", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_standard_years | assert | func_call | 22 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("It is currently 2023.", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_standard_years | assert | func_call | 20 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("The battle was in 1066.", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_date_normalization_comprehensive.py | test_years_with_markers | assert | func_call | 18 | import pytest
from abogen.kokoro_text_normalization import (
_normalize_grouped_numbers,
ApostropheConfig,
)
def cfg():
return ApostropheConfig(convert_numbers=True, year_pronunciation_mode="american")
def normalize(text, config):
return _normalize_grouped_numbers(text, config)
class TestDateNormaliz... | normalize("It happened in 1021 BC.", cfg) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chapter_overrides.py | test_apply_chapter_overrides_with_custom_text | assert | numeric_literal | 120 | from __future__ import annotations
import sys
import types
def _install_dependency_stubs() -> None:
if "ebooklib" not in sys.modules:
ebooklib_stub = types.ModuleType("ebooklib")
epub_stub = types.ModuleType("ebooklib.epub")
setattr(ebooklib_stub, "epub", epub_stub)
sys.modules["eb... | 1 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_helpers.py | test_chunk_text_merges_title_abbreviations | assert | numeric_literal | 19 | from __future__ import annotations
from types import SimpleNamespace
from abogen.chunking import chunk_text
from abogen.webui.conversion_runner import _chunk_voice_spec, _group_chunks_by_chapter
def test_chunk_text_merges_title_abbreviations() -> None:
text = "Dr. Watson met Mr. Holmes at 5 p.m."
chunks = c... | 1 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_chunk_helpers.py | test_chunk_text_display_preserves_whitespace | assert | numeric_literal | 19 | from __future__ import annotations
from types import SimpleNamespace
from abogen.chunking import chunk_text
from abogen.webui.conversion_runner import _chunk_voice_spec, _group_chunks_by_chapter
def test_chunk_text_display_preserves_whitespace() -> None:
text = "Line one with double spaces.\nSecond line\n\nThi... | 2 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_exporter.py | test_epub3_sentence_chunks_render_as_paragraphs | assert | numeric_literal | 89 | from __future__ import annotations
import html
import re
import zipfile
from abogen.epub3.exporter import build_epub3_package
from abogen.text_extractor import ExtractedChapter, ExtractionResult
def _make_sample_extraction() -> ExtractionResult:
return ExtractionResult(
chapters=[
ExtractedCh... | 2 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_ffmetadata.py | test_render_ffmetadata_includes_chapters | assert | numeric_literal | 27 | from __future__ import annotations
from pathlib import Path
from abogen.webui.conversion_runner import _render_ffmetadata, _write_ffmetadata_file
def test_render_ffmetadata_includes_chapters(tmp_path):
metadata = {
"title": "Sample Book",
"artist": "Author Name",
"comment": "Line one\nLin... | 2 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_tts_supertonic_unsupported_chars.py | test_supertonic_pipeline_strips_unsupported_characters_and_retries | assert | numeric_literal | 15 | import numpy as np
from abogen.tts_supertonic import SupertonicPipeline
def test_supertonic_pipeline_strips_unsupported_characters_and_retries():
# Avoid importing/initializing real supertonic by manually constructing the pipeline.
pipeline = SupertonicPipeline.__new__(SupertonicPipeline)
pipeline.sample_... | 1 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_tts_supertonic_unsupported_chars.py | test_supertonic_pipeline_strips_unsupported_characters_and_retries | assert | numeric_literal | 19 | import numpy as np
from abogen.tts_supertonic import SupertonicPipeline
def test_supertonic_pipeline_strips_unsupported_characters_and_retries():
# Avoid importing/initializing real supertonic by manually constructing the pipeline.
pipeline = SupertonicPipeline.__new__(SupertonicPipeline)
pipeline.sample_... | 0 | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_find_position_robust_logic | self.assertGreater | numeric_literal | 89 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | 0) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_book_parser.py | test_get_chapters | self.assertEqual | numeric_literal | 86 | import unittest
import os
import sys
import shutil
import fitz # PyMuPDF
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser, PdfParser, EpubParser, MarkdownParser
class TestBookParser(unittest.TestCase):
de... | 2) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_content_slicing.py | test_single_file_multiple_chapters | self.assertEqual | numeric_literal | 97 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubContentSlicing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | 2) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_html_nav_parsing.py | test_basic_html_nav_parsing | self.assertEqual | numeric_literal | 94 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubHtmlNavParsing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | 2) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | v2_extractor_at_anchor |
denizsafak/abogen | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 0 | train | train | tests/test_epub_html_nav_parsing.py | test_span_header_parsing | self.assertEqual | numeric_literal | 108 | import unittest
import os
import shutil
import sys
from ebooklib import epub
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from abogen.book_parser import get_book_parser
class TestEpubHtmlNavParsing(unittest.TestCase):
def setUp(self):
self.test_dir = "tests/test_dat... | 1) | ded73843c9e431f53cc215d6ae4f80d7cf3fe618 | 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.