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
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-utils-workflow/tests/test_drawing.py
test_mermaid_edges_generation
assert
numeric_literal
21
from unittest.mock import MagicMock, mock_open, patch import pytest from llama_index.utils.workflow import ( draw_all_possible_flows, draw_all_possible_flows_mermaid, draw_most_recent_execution, draw_most_recent_execution_mermaid, ) from workflows.workflow import Workflow def test_mermaid_edges_genera...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-utils-workflow/tests/test_drawing.py
test_mermaid_edges_generation
assert
numeric_literal
25
from unittest.mock import MagicMock, mock_open, patch import pytest from llama_index.utils.workflow import ( draw_all_possible_flows, draw_all_possible_flows_mermaid, draw_most_recent_execution, draw_most_recent_execution_mermaid, ) from workflows.workflow import Workflow def test_mermaid_edges_genera...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-utils-workflow/tests/test_drawing.py
test_resource_node_deduplication_in_rendering
assert
numeric_literal
33
from unittest.mock import MagicMock, mock_open, patch import pytest from llama_index.utils.workflow import ( draw_all_possible_flows, draw_all_possible_flows_mermaid, draw_most_recent_execution, draw_most_recent_execution_mermaid, ) from workflows.workflow import Workflow def test_resource_node_dedupl...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/client/test_client.py
test_list_workflows
assert
numeric_literal
33
import httpx import pytest from httpx import ASGITransport, AsyncClient from workflows.client import WorkflowClient from workflows.protocol.serializable_events import EventEnvelopeWithMetadata from workflows.server.memory_workflow_store import MemoryWorkflowStore from workflows.server.server import WorkflowServer from...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/client/test_client.py
test_run_nowait_and_stream_events
assert
numeric_literal
42
import httpx import pytest from httpx import ASGITransport, AsyncClient from workflows.client import WorkflowClient from workflows.protocol.serializable_events import EventEnvelopeWithMetadata from workflows.server.memory_workflow_store import MemoryWorkflowStore from workflows.server.server import WorkflowServer from...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/client/test_client.py
test_get_handlers
assert
numeric_literal
38
import httpx import pytest from httpx import ASGITransport, AsyncClient from workflows.client import WorkflowClient from workflows.protocol.serializable_events import EventEnvelopeWithMetadata from workflows.server.memory_workflow_store import MemoryWorkflowStore from workflows.server.server import WorkflowServer from...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/context/test_context.py
test_collect_events_with_extra_event_type
assert
numeric_literal
87
from __future__ import annotations import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel from workflows.context import Context from workflows.context.state_store import DictState from workflows.decorators import step from workflows.errors import WorkflowRuntimeError from workf...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/context/test_context.py
test_empty_inprogress_when_workflow_done
assert
numeric_literal
41
from __future__ import annotations import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel from workflows.context import Context from workflows.context.state_store import DictState from workflows.decorators import step from workflows.errors import WorkflowRuntimeError from workf...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/context/test_context.py
test_wait_for_event_in_workflow_serialization
assert
numeric_literal
73
from __future__ import annotations import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel from workflows.context import Context from workflows.context.state_store import DictState from workflows.decorators import step from workflows.errors import WorkflowRuntimeError from workf...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/context/test_context.py
collector
assert
numeric_literal
60
from __future__ import annotations import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel from workflows.context import Context from workflows.context.state_store import DictState from workflows.decorators import step from workflows.errors import WorkflowRuntimeError from workf...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/protocol/test_serializable_events.py
test_parse_with_registry_type_success
assert
numeric_literal
24
import json import pytest from workflows.events import ( Event, StepState, StepStateChanged, StopEvent, ) from workflows.protocol.serializable_events import ( EventEnvelope, EventEnvelopeWithMetadata, EventValidationError, ) def test_parse_with_registry_type_success() -> None: class My...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/protocol/test_serializable_events.py
test_parse_with_qualified_name_fallback_success
assert
numeric_literal
22
import json import pytest from workflows.events import ( Event, StepState, StepStateChanged, StopEvent, ) from workflows.protocol.serializable_events import ( EventEnvelope, EventEnvelopeWithMetadata, EventValidationError, ) def test_parse_with_qualified_name_fallback_success() -> None: ...
7
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/protocol/test_serializable_events.py
test_parse_with_type_unknown_but_qualified_name_valid
assert
numeric_literal
22
import json import pytest from workflows.events import ( Event, StepState, StepStateChanged, StopEvent, ) from workflows.protocol.serializable_events import ( EventEnvelope, EventEnvelopeWithMetadata, EventValidationError, ) def test_parse_with_type_unknown_but_qualified_name_valid() -> No...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/protocol/test_serializable_events.py
test_parse_alias_data_to_value
assert
numeric_literal
24
import json import pytest from workflows.events import ( Event, StepState, StepStateChanged, StopEvent, ) from workflows.protocol.serializable_events import ( EventEnvelope, EventEnvelopeWithMetadata, EventValidationError, ) def test_parse_alias_data_to_value() -> None: class MyEvent(E...
9
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/protocol/test_serializable_events.py
test_from_event_roundtrip_with_registry
assert
numeric_literal
25
import json import pytest from workflows.events import ( Event, StepState, StepStateChanged, StopEvent, ) from workflows.protocol.serializable_events import ( EventEnvelope, EventEnvelopeWithMetadata, EventValidationError, ) def test_from_event_roundtrip_with_registry() -> None: class ...
5
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop.py
test_control_loop_step_failure_publishes_stop_event
assert
numeric_literal
141
import asyncio import time import uuid from typing import Coroutine, Optional, Union import pytest import time_machine from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowCancelledByUser, WorkflowTimeoutError from workflows.events import ( Event, Hum...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop.py
test_control_loop_step_failure_publishes_stop_event
assert
numeric_literal
142
import asyncio import time import uuid from typing import Coroutine, Optional, Union import pytest import time_machine from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowCancelledByUser, WorkflowTimeoutError from workflows.events import ( Event, Hum...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop.py
test_control_loop_stream_events
assert
numeric_literal
112
import asyncio import time import uuid from typing import Coroutine, Optional, Union import pytest import time_machine from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowCancelledByUser, WorkflowTimeoutError from workflows.events import ( Event, Hum...
7
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop.py
test_control_loop_retry_with_delay
assert
numeric_literal
121
import asyncio import time import uuid from typing import Coroutine, Optional, Union import pytest import time_machine from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowCancelledByUser, WorkflowTimeoutError from workflows.events import ( Event, Hum...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop.py
test_control_loop_retry_exhaustion_respects_total_time
assert
numeric_literal
138
import asyncio import time import uuid from typing import Coroutine, Optional, Union import pytest import time_machine from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowCancelledByUser, WorkflowTimeoutError from workflows.events import ( Event, Hum...
4
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop_transformations.py
test_add_event_unhandled_emits_internal_event
assert
numeric_literal
122
from __future__ import annotations from typing import Any, cast import pytest from workflows.decorators import StepConfig from workflows.errors import WorkflowTimeoutError from workflows.events import ( Event, InputRequiredEvent, StartEvent, StepState, StepStateChanged, StopEvent, Unhandle...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop_transformations.py
test_add_event_input_required_does_not_emit_unhandled
assert
numeric_literal
128
from __future__ import annotations from typing import Any, cast import pytest from workflows.decorators import StepConfig from workflows.errors import WorkflowTimeoutError from workflows.events import ( Event, InputRequiredEvent, StartEvent, StepState, StepStateChanged, StopEvent, Unhandle...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_control_loop_transformations.py
test_cancel_run
assert
numeric_literal
124
from __future__ import annotations from typing import Any, cast import pytest from workflows.decorators import StepConfig from workflows.errors import WorkflowTimeoutError from workflows.events import ( Event, InputRequiredEvent, StartEvent, StepState, StepStateChanged, StopEvent, Unhandle...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_idle_release.py
test_is_idle_query_filter_memory_store
assert
numeric_literal
121
import asyncio from datetime import datetime, timedelta, timezone from typing import Any, Optional import pytest import time_machine from httpx import ASGITransport, AsyncClient from workflows import Context, Workflow, step from workflows.events import HumanResponseEvent, StartEvent, StopEvent from workflows.server.ab...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_idle_release.py
test_is_idle_query_filter_memory_store
assert
numeric_literal
126
import asyncio from datetime import datetime, timedelta, timezone from typing import Any, Optional import pytest import time_machine from httpx import ASGITransport, AsyncClient from workflows import Context, Workflow, step from workflows.events import HumanResponseEvent, StartEvent, StopEvent from workflows.server.ab...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_idle_release.py
test_is_idle_query_filter_memory_store
assert
numeric_literal
131
import asyncio from datetime import datetime, timedelta, timezone from typing import Any, Optional import pytest import time_machine from httpx import ASGITransport, AsyncClient from workflows import Context, Workflow, step from workflows.events import HumanResponseEvent, StartEvent, StopEvent from workflows.server.ab...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_main.py
test_no_file_path_argument
assert
numeric_literal
17
import os from pathlib import Path from typing import Any from unittest.mock import patch import pytest from workflows.server.__main__ import run_server def test_no_file_path_argument(capsys: Any) -> None: """Test that the script exits with usage message when no file path is provided.""" with patch("sys.argv"...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_memory_workflow_store.py
test_update_and_query_returns_inserted_handler
assert
numeric_literal
27
from datetime import datetime, timezone import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.memory_workflow_store import MemoryWorkflowStore @pytest.mark.asyncio async def test_update_and_query_returns_inserted...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_memory_workflow_store.py
test_delete_noop_on_empty_filter
assert
numeric_literal
24
from datetime import datetime, timezone import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.memory_workflow_store import MemoryWorkflowStore @pytest.mark.asyncio async def test_delete_noop_on_empty_filter() -> ...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_memory_workflow_store.py
test_delete_removes_multiple_matching_handlers
assert
numeric_literal
26
from datetime import datetime, timezone import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.memory_workflow_store import MemoryWorkflowStore @pytest.mark.asyncio async def test_delete_removes_multiple_matching_...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_migrations.py
test_run_migrations_on_empty_db
assert
numeric_literal
23
from __future__ import annotations import sqlite3 from pathlib import Path from typing import List from workflows.server.sqlite.migrate import run_migrations def _get_table_columns(conn: sqlite3.Connection, table: str) -> List[str]: cursor = conn.execute(f"PRAGMA table_info({table})") return [row[1] for row ...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_migrations.py
test_run_migrations_on_empty_db
assert
numeric_literal
28
from __future__ import annotations import sqlite3 from pathlib import Path from typing import List from workflows.server.sqlite.migrate import run_migrations def _get_table_columns(conn: sqlite3.Connection, table: str) -> List[str]: cursor = conn.execute(f"PRAGMA table_info({table})") return [row[1] for row ...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_migrations.py
test_migrate_from_version_1
assert
numeric_literal
35
from __future__ import annotations import sqlite3 from pathlib import Path from typing import List from workflows.server.sqlite.migrate import run_migrations def _get_table_columns(conn: sqlite3.Connection, table: str) -> List[str]: cursor = conn.execute(f"PRAGMA table_info({table})") return [row[1] for row ...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_persistent_handler_serialization.py
test_stop_event_round_trip
assert
numeric_literal
22
from __future__ import annotations from typing import Any, cast from workflows.events import StopEvent from workflows.server.abstract_workflow_store import PersistentHandler def _base_handler_kwargs() -> dict[str, Any]: return { "handler_id": "h1", "workflow_name": "wf", "status": cast("s...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server.py
test_init
assert
numeric_literal
12
from typing import Any from unittest.mock import AsyncMock, Mock, patch import pytest from starlette.middleware import Middleware from workflows.server import WorkflowServer from workflows.workflow import Workflow def test_init() -> None: server = WorkflowServer() assert len(server._middleware) ==
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_endpoints.py
test_health_check
assert
numeric_literal
75
from __future__ import annotations import asyncio import json from collections import Counter from contextlib import asynccontextmanager from datetime import datetime from types import SimpleNamespace from typing import Any, AsyncGenerator, AsyncIterator import pytest import pytest_asyncio from httpx import ASGITrans...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_endpoints.py
test_stream_events_success
assert
numeric_literal
98
from __future__ import annotations import asyncio import json from collections import Counter from contextlib import asynccontextmanager from datetime import datetime from types import SimpleNamespace from typing import Any, AsyncGenerator, AsyncIterator import pytest import pytest_asyncio from httpx import ASGITrans...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_endpoints.py
test_stream_events_sse
assert
numeric_literal
110
from __future__ import annotations import asyncio import json from collections import Counter from contextlib import asynccontextmanager from datetime import datetime from types import SimpleNamespace from typing import Any, AsyncGenerator, AsyncIterator import pytest import pytest_asyncio from httpx import ASGITrans...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_endpoints.py
test_stream_events_single_consumer
assert
numeric_literal
94
from __future__ import annotations import asyncio import json from collections import Counter from contextlib import asynccontextmanager from datetime import datetime from types import SimpleNamespace from typing import Any, AsyncGenerator, AsyncIterator import pytest import pytest_asyncio from httpx import ASGITrans...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_endpoints.py
test_stream_events_after_completion_should_return_unconsumed_events
assert
numeric_literal
109
from __future__ import annotations import asyncio import json from collections import Counter from contextlib import asynccontextmanager from datetime import datetime from types import SimpleNamespace from typing import Any, AsyncGenerator, AsyncIterator import pytest import pytest_asyncio from httpx import ASGITrans...
4
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_persistence.py
test_persistence_retries_on_failure
assert
numeric_literal
98
import asyncio from typing import AsyncGenerator import pytest from httpx import ASGITransport, AsyncClient from workflows import Context from workflows.events import Event, InternalDispatchEvent, StopEvent from workflows.server import WorkflowServer from workflows.server.abstract_workflow_store import HandlerQuery, P...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_persistence.py
test_resume_across_runs
assert
numeric_literal
109
import asyncio from typing import AsyncGenerator import pytest from httpx import ASGITransport, AsyncClient from workflows import Context from workflows.events import Event, InternalDispatchEvent, StopEvent from workflows.server import WorkflowServer from workflows.server.abstract_workflow_store import HandlerQuery, P...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_sqlite_workflow_store.py
test_update_and_query_returns_inserted_handler
assert
numeric_literal
28
from pathlib import Path import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.sqlite.sqlite_workflow_store import SqliteWorkflowStore @pytest.mark.asyncio async def test_update_and_query_returns_inserted_handler...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_sqlite_workflow_store.py
test_delete_noop_on_empty_filter
assert
numeric_literal
25
from pathlib import Path import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.sqlite.sqlite_workflow_store import SqliteWorkflowStore @pytest.mark.asyncio async def test_delete_noop_on_empty_filter(tmp_path: Pat...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_event_init_basic
assert
numeric_literal
18
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_event_init_basic() -> None: evt = Event(a=1, ...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_event_init_basic
assert
numeric_literal
19
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_event_init_basic() -> None: evt = Event(a=1, ...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_custom_event_override_init
assert
numeric_literal
22
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_custom_event_override_init() -> None: evt = _...
4
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_event_dict_api
assert
numeric_literal
17
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_event_dict_api() -> None: ev = _TestEvent(par...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_workflow_failed_event
assert
numeric_literal
29
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_workflow_failed_event() -> None: """Test Work...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_workflow_failed_event_with_nested_exception_type
assert
numeric_literal
26
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_workflow_failed_event_with_nested_exception_type(...
5
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_nanoid.py
test_nanoid_custom_length
assert
numeric_literal
7
from workflows.utils import _nanoid as nanoid def test_nanoid_custom_length() -> None: """Test nanoid with custom length.""" result = nanoid(3) assert len(result) ==
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_nanoid.py
test_nanoid_zero_length
assert
numeric_literal
7
from workflows.utils import _nanoid as nanoid def test_nanoid_zero_length() -> None: """Test nanoid with zero length.""" result = nanoid(0) assert len(result) ==
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_representation_utils.py
test_graph_serialization
assert
numeric_literal
86
from typing import Annotated import pytest from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.protocol import ( WorkflowEventNode, WorkflowExternalNode, WorkflowGraph, WorkflowGraphEdge, WorkflowResourceNode, WorkflowStepNode, ) from w...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_representation_utils.py
test_graph_serialization
assert
numeric_literal
99
from typing import Annotated import pytest from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.protocol import ( WorkflowEventNode, WorkflowExternalNode, WorkflowGraph, WorkflowGraphEdge, WorkflowResourceNode, WorkflowStepNode, ) from w...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_representation_utils.py
test_graph_with_all_node_types_serialization
assert
numeric_literal
105
from typing import Annotated import pytest from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.protocol import ( WorkflowEventNode, WorkflowExternalNode, WorkflowGraph, WorkflowGraphEdge, WorkflowResourceNode, WorkflowStepNode, ) from w...
4
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_resources.py
test_caching_behavior
assert
numeric_literal
61
import json from pathlib import Path from typing import Annotated, Optional from unittest import mock import pytest from pydantic import BaseModel, Field from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.resource import ( Resource, ResourceConfig, ...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_resources.py
test_non_caching_behavior
assert
numeric_literal
65
import json from pathlib import Path from typing import Annotated, Optional from unittest import mock import pytest from pydantic import BaseModel, Field from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.resource import ( Resource, ResourceConfig, ...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_retry_policy.py
test_ConstantDelayRetryPolicy_init
assert
numeric_literal
12
import pytest from workflows.context import Context from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.retry_policy import ConstantDelayRetryPolicy from workflows.testing import WorkflowTestRunner from workflows.workflow import Workflow def test_ConstantDelay...
3
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_retry_policy.py
test_ConstantDelayRetryPolicy_init
assert
numeric_literal
13
import pytest from workflows.context import Context from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.retry_policy import ConstantDelayRetryPolicy from workflows.testing import WorkflowTestRunner from workflows.workflow import Workflow def test_ConstantDelay...
5
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_streaming.py
test_resume_streams
assert
numeric_literal
36
import asyncio from typing import AsyncGenerator import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowRuntimeError, WorkflowTimeoutError from workflows.events import Event, StartEvent, StopEvent from workflows.testing import WorkflowTestRunner f...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_testing_utils.py
test_testing_utils
assert
numeric_literal
24
import pytest from workflows import Context, Workflow, step from workflows.events import ( Event, StartEvent, StepStateChanged, StopEvent, ) from workflows.testing import WorkflowTestRunner from workflows.testing.runner import WorkflowTestResult @pytest.mark.asyncio async def test_testing_utils() -> No...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_utils.py
test_get_param_types
assert
numeric_literal
32
import inspect from typing import Any, List, Optional, Union, get_type_hints import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowValidationError from workflows.events import StartEvent, StopEvent from workflows.utils import ( _get_param_typ...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_utils.py
test_get_param_types_union
assert
numeric_literal
32
import inspect from typing import Any, List, Optional, Union, get_type_hints import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowValidationError from workflows.events import StartEvent, StopEvent from workflows.utils import ( _get_param_typ...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_workflow.py
test_workflow_num_workers
assert
numeric_literal
93
from __future__ import annotations import asyncio import gc import logging import pickle import threading import weakref from typing import Any, Callable, Union, cast from unittest import mock import pytest from llama_index_instrumentation.dispatcher import active_instrument_tags from pydantic import PrivateAttr from...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_workflow.py
test_workflow_continue_context
assert
numeric_literal
73
from __future__ import annotations import asyncio import gc import logging import pickle import threading import weakref from typing import Any, Callable, Union, cast from unittest import mock import pytest from llama_index_instrumentation.dispatcher import active_instrument_tags from pydantic import PrivateAttr from...
2
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_workflow.py
test_custom_stop_event
assert
numeric_literal
75
from __future__ import annotations import asyncio import gc import logging import pickle import threading import weakref from typing import Any, Callable, Union, cast from unittest import mock import pytest from llama_index_instrumentation.dispatcher import active_instrument_tags from pydantic import PrivateAttr from...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_workflow_internal_events.py
test_internal_events
assert
numeric_literal
36
import asyncio from typing import Union import pytest from pydantic import BaseModel from workflows import Context, Workflow, step from workflows.events import ( Event, StartEvent, StepState, StepStateChanged, StopEvent, ) from workflows.testing import WorkflowTestRunner def wf() -> ExampleWorkflo...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_workflow_typed_state.py
test_typed_state_with_context_manager
assert
numeric_literal
19
import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel, Field from workflows import Context, Workflow from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.testing import WorkflowTestRunner @pytest.mark.asyncio async def ...
1
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/workflows-dev/tests/test_workflows_dev_cli.py
test_compute_tag_metadata_requires_tag
assert
numeric_literal
53
from __future__ import annotations import json import subprocess from pathlib import Path from unittest.mock import Mock, patch from urllib.error import HTTPError from click.testing import CliRunner from workflows_dev.changesets import ( PackageJson, PyProjectContainer, current_version, is_published, ...
0
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-utils-workflow/tests/test_drawing.py
test_draw_all_possible_flows_with_max_label_length
assert
numeric_literal
58
from unittest.mock import MagicMock, mock_open, patch import pytest from llama_index.utils.workflow import ( draw_all_possible_flows, draw_all_possible_flows_mermaid, draw_most_recent_execution, draw_most_recent_execution_mermaid, ) from workflows.workflow import Workflow def test_draw_all_possible_fl...
10
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/context/test_context.py
test_get_default
assert
numeric_literal
33
from __future__ import annotations import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel from workflows.context import Context from workflows.context.state_store import DictState from workflows.decorators import step from workflows.errors import WorkflowRuntimeError from workf...
42
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_identity_weak_ref.py
test_identity_weak_key_dict_removes_entry_when_object_unreferenced
assert
variable
20
from __future__ import annotations import gc import weakref import pytest from workflows.runtime.types._identity_weak_ref import IdentityWeakKeyDict def test_identity_weak_key_dict_removes_entry_when_object_unreferenced() -> None: with pytest.raises(TypeError): hash(Unhashable()) d: IdentityWeakKeyD...
d
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_endpoints.py
test_stream_events_success
assert
variable
102
from __future__ import annotations import asyncio import json from collections import Counter from contextlib import asynccontextmanager from datetime import datetime from types import SimpleNamespace from typing import Any, AsyncGenerator, AsyncIterator import pytest import pytest_asyncio from httpx import ASGITrans...
i
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_workflow.py
test__get_start_event_instance
assert
variable
53
from __future__ import annotations import asyncio import gc import logging import pickle import threading import weakref from typing import Any, Callable, Union, cast from unittest import mock import pytest from llama_index_instrumentation.dispatcher import active_instrument_tags from pydantic import PrivateAttr from...
e
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_streaming.py
test_multiple_ongoing_streams
assert
variable
23
import asyncio from typing import AsyncGenerator import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowRuntimeError, WorkflowTimeoutError from workflows.events import Event, StartEvent, StopEvent from workflows.testing import WorkflowTestRunner f...
ev
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_memory_workflow_store.py
test_store_handles_all_datetime_fields
assert
variable
34
from datetime import datetime, timezone import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.memory_workflow_store import MemoryWorkflowStore @pytest.mark.asyncio async def test_store_handles_all_datetime_fields...
now
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_event.py
test_workflow_timed_out_event_repr
assert
variable
19
from typing import Any, cast import pytest from pydantic import PrivateAttr from workflows.context import JsonSerializer from workflows.events import ( Event, StopEvent, WorkflowCancelledEvent, WorkflowFailedEvent, WorkflowTimedOutEvent, ) def test_workflow_timed_out_event_repr() -> None: """T...
rep
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_utils.py
test_get_param_types
assert
variable
33
import inspect from typing import Any, List, Optional, Union, get_type_hints import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowValidationError from workflows.events import StartEvent, StopEvent from workflows.utils import ( _get_param_typ...
str
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_utils.py
test_get_param_types_no_annotations
assert
variable
33
import inspect from typing import Any, List, Optional, Union, get_type_hints import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowValidationError from workflows.events import StartEvent, StopEvent from workflows.utils import ( _get_param_typ...
Any
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-utils-workflow/tests/test_drawing.py
test_mermaid_resource_nodes_rendered
assert
variable
32
from unittest.mock import MagicMock, mock_open, patch import pytest from llama_index.utils.workflow import ( draw_all_possible_flows, draw_all_possible_flows_mermaid, draw_most_recent_execution, draw_most_recent_execution_mermaid, ) from workflows.workflow import Workflow def test_mermaid_resource_nod...
line
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/protocol/test_serializable_events.py
test_envelope_stop_event_subclass
assert
variable
30
import json import pytest from workflows.events import ( Event, StepState, StepStateChanged, StopEvent, ) from workflows.protocol.serializable_events import ( EventEnvelope, EventEnvelopeWithMetadata, EventValidationError, ) def test_envelope_stop_event_subclass() -> None: class MyStop...
types
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_openapi_schema.py
test_openapi_schema_includes_all_routes
assert
variable
27
from workflows import Workflow from workflows.server import WorkflowServer def test_openapi_schema_includes_all_routes(simple_test_workflow: Workflow) -> None: server = WorkflowServer() server.add_workflow("test", simple_test_workflow) schema = server.openapi_schema() assert "paths" in schema path...
paths
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_sqlite_workflow_store.py
test_update_pydantic_result_serialization
assert
variable
42
from pathlib import Path import pytest from workflows.events import StopEvent from workflows.server.abstract_workflow_store import HandlerQuery, PersistentHandler from workflows.server.sqlite.sqlite_workflow_store import SqliteWorkflowStore @pytest.mark.asyncio @pytest.mark.parametrize( "event", [StopEvent(re...
event
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_retry_policy.py
test_ConstantDelayRetryPolicy_next
assert
variable
13
import pytest from workflows.context import Context from workflows.decorators import step from workflows.events import Event, StartEvent, StopEvent from workflows.retry_policy import ConstantDelayRetryPolicy from workflows.testing import WorkflowTestRunner from workflows.workflow import Workflow def test_ConstantDelay...
delay
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/test_utils.py
test_get_steps_from
assert
variable
40
import inspect from typing import Any, List, Optional, Union, get_type_hints import pytest from workflows.context import Context from workflows.decorators import step from workflows.errors import WorkflowValidationError from workflows.events import StartEvent, StopEvent from workflows.utils import ( _get_param_typ...
steps
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-utils-workflow/tests/test_drawing.py
test_mermaid_resource_nodes_rendered
assert
variable
20
from unittest.mock import MagicMock, mock_open, patch import pytest from llama_index.utils.workflow import ( draw_all_possible_flows, draw_all_possible_flows_mermaid, draw_most_recent_execution, draw_most_recent_execution_mermaid, ) from workflows.workflow import Workflow def test_mermaid_resource_nod...
result
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/client/test_client.py
test_get_result_for_handler
assert
variable
47
import httpx import pytest from httpx import ASGITransport, AsyncClient from workflows.client import WorkflowClient from workflows.protocol.serializable_events import EventEnvelopeWithMetadata from workflows.server.memory_workflow_store import MemoryWorkflowStore from workflows.server.server import WorkflowServer from...
result
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/context/test_context.py
test_send_event_step_is_none
assert
variable
38
from __future__ import annotations import asyncio from typing import Optional, Union import pytest from pydantic import BaseModel from workflows.context import Context from workflows.context.state_store import DictState from workflows.decorators import step from workflows.errors import WorkflowRuntimeError from workf...
replay
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_migrations.py
test_run_migrations_on_empty_db
assert
variable
50
from __future__ import annotations import sqlite3 from pathlib import Path from typing import List from workflows.server.sqlite.migrate import run_migrations def _get_table_columns(conn: sqlite3.Connection, table: str) -> List[str]: cursor = conn.execute(f"PRAGMA table_info({table})") return [row[1] for row ...
before
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_openapi_schema.py
test_openapi_schema_includes_all_routes
assert
variable
10
from workflows import Workflow from workflows.server import WorkflowServer def test_openapi_schema_includes_all_routes(simple_test_workflow: Workflow) -> None: server = WorkflowServer() server.add_workflow("test", simple_test_workflow) schema = server.openapi_schema() assert "paths" in
schema
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_migrations.py
test_run_migrations_on_empty_db
assert
variable
44
from __future__ import annotations import sqlite3 from pathlib import Path from typing import List from workflows.server.sqlite.migrate import run_migrations def _get_table_columns(conn: sqlite3.Connection, table: str) -> List[str]: cursor = conn.execute(f"PRAGMA table_info({table})") return [row[1] for row ...
columns
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_persistent_handler_serialization.py
test_stop_event_subclass_round_trip
assert
variable
27
from __future__ import annotations from typing import Any, cast from workflows.events import StopEvent from workflows.server.abstract_workflow_store import PersistentHandler def _base_handler_kwargs() -> dict[str, Any]: return { "handler_id": "h1", "workflow_name": "wf", "status": cast("s...
payload
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/workflows-dev/tests/test_workflows_dev_cli.py
test_update_index_html_success
assert
variable
77
from __future__ import annotations import json import subprocess from pathlib import Path from unittest.mock import Mock, patch from urllib.error import HTTPError from click.testing import CliRunner from workflows_dev.changesets import ( PackageJson, PyProjectContainer, current_version, is_published, ...
updated
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/workflows-dev/tests/test_workflows_dev_cli.py
test_compute_tag_metadata_patch
assert
variable
73
from __future__ import annotations import json import subprocess from pathlib import Path from unittest.mock import Mock, patch from urllib.error import HTTPError from click.testing import CliRunner from workflows_dev.changesets import ( PackageJson, PyProjectContainer, current_version, is_published, ...
contents
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_main.py
test_environment_variables
assert
variable
35
import os from pathlib import Path from typing import Any from unittest.mock import patch import pytest from workflows.server.__main__ import run_server def test_environment_variables(tmp_path: Path) -> None: """Test that environment variables are used for host and port.""" test_file = tmp_path / "env_test.py...
test_host
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/client/test_client.py
test_get_handler
assert
variable
39
import httpx import pytest from httpx import ASGITransport, AsyncClient from workflows.client import WorkflowClient from workflows.protocol.serializable_events import EventEnvelopeWithMetadata from workflows.server.memory_workflow_store import MemoryWorkflowStore from workflows.server.server import WorkflowServer from...
handler_id
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/runtime/test_identity_weak_ref.py
test_identity_weak_key_dict_removes_entry_when_object_unreferenced
pytest.raises
variable
11
from __future__ import annotations import gc import weakref import pytest from workflows.runtime.types._identity_weak_ref import IdentityWeakKeyDict def test_identity_weak_key_dict_removes_entry_when_object_unreferenced() -> None: with pytest.raises(
TypeError)
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_keyed_lock.py
test_parallel_access_mutual_exclusion_with_race_detection
assert
variable
29
from __future__ import annotations import asyncio import pytest from workflows.server.keyed_lock import KeyedLock def locks() -> KeyedLock: return KeyedLock() async def test_parallel_access_mutual_exclusion_with_race_detection( locks: KeyedLock, ) -> None: """Test mutual exclusion using race condition d...
iterations
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server.py
test_extract_workflow_missing_name
pytest.raises
variable
15
from typing import Any from unittest.mock import AsyncMock, Mock, patch import pytest from starlette.middleware import Middleware from workflows.server import WorkflowServer from workflows.workflow import Workflow def test_extract_workflow_missing_name() -> None: server = WorkflowServer() mock_request = Mock(...
Exception)
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor
run-llama/workflows-py
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
train
train
packages/llama-index-workflows/tests/server/test_server_persistence.py
test_workflow_cancelled_after_all_retries_fail
pytest.raises
variable
83
import asyncio from typing import AsyncGenerator import pytest from httpx import ASGITransport, AsyncClient from workflows import Context from workflows.events import Event, InternalDispatchEvent, StopEvent from workflows.server import WorkflowServer from workflows.server.abstract_workflow_store import HandlerQuery, P...
Exception)
7a85c96d684d59bf871056f3dbc6329ec71f95f2
80
v2_extractor_at_anchor