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
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/repl/test_local_repl.py
test_persistent_execution
assert
numeric_literal
17
from rlm.environments.local_repl import LocalREPL def test_persistent_execution(): """Test that variables persist across multiple code executions.""" repl = LocalREPL() # Set a variable result1 = repl.execute_code("x = 42") assert result1.stderr == "" assert "x" in repl.locals assert repl....
50
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/repl/test_local_repl.py
test_persistent_execution
assert
complex_expr
11
from rlm.environments.local_repl import LocalREPL def test_persistent_execution(): """Test that variables persist across multiple code executions.""" repl = LocalREPL() # Set a variable result1 = repl.execute_code("x = 42") assert result1.stderr == "" assert "x" in
repl.locals
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_imports.py
test_rlm_rlm_import
assert
none_literal
14
import importlib import sys from collections import defaultdict import pytest class TestTopLevelImports: def test_rlm_rlm_import(self): """Test that RLM class can be imported from rlm.""" from rlm import RLM assert RLM is not
None
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_simple_execution
assert
numeric_literal
13
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLBasic: def test_simple_execution(self): """Test basic code execution.""" repl = LocalREPL() result = repl.execute_code("x = 1 + 2") assert result.stderr == "" assert repl.locals["x"] ==
3
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_cleanup_clears_state
assert
numeric_literal
14
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLCleanup: def test_cleanup_clears_state(self): """Test that cleanup clears the namespace.""" repl = LocalREPL() repl.execute_code("x = 42") assert "x" in repl.locals repl.cleanup() asser...
0
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_simple_execution
assert
string_literal
12
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLBasic: def test_simple_execution(self): """Test basic code execution.""" repl = LocalREPL() result = repl.execute_code("x = 1 + 2") assert result.stderr ==
""
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_variable_persistence
assert
numeric_literal
14
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLPersistence: def test_variable_persistence(self): """Test that variables persist across multiple code executions.""" repl = LocalREPL() result1 = repl.execute_code("x = 42") assert result1.stderr == ""...
42
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_variable_persistence
assert
numeric_literal
18
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLPersistence: def test_variable_persistence(self): """Test that variables persist across multiple code executions.""" repl = LocalREPL() result1 = repl.execute_code("x = 42") assert result1.stderr == ""...
50
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_safe_builtins_available
assert
numeric_literal
17
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLBuiltins: def test_safe_builtins_available(self): """Test that safe builtins are available.""" repl = LocalREPL() # Test various safe builtins _ = repl.execute_code("x = len([1, 2, 3])") assert...
10
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_context_manager
assert
numeric_literal
12
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLContextManager: def test_context_manager(self): """Test using LocalREPL as context manager.""" with LocalREPL() as repl: _ = repl.execute_code("x = 100") assert repl.locals["x"] ==
100
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_final_var_existing
assert
string_literal
13
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLHelpers: def test_final_var_existing(self): """Test FINAL_VAR with existing variable.""" repl = LocalREPL() repl.execute_code("answer = 42") _ = repl.execute_code("result = FINAL_VAR('answer')") ...
"42"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_imports_work
assert
numeric_literal
13
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLBuiltins: def test_imports_work(self): """Test that imports work.""" repl = LocalREPL() result = repl.execute_code("import math\nx = math.pi") assert result.stderr == "" assert abs(repl.locals[...
0.001
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_dict_context
assert
string_literal
12
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLContext: def test_dict_context(self): """Test loading dict context.""" repl = LocalREPL(context_payload={"key": "value", "number": 42}) assert "context" in repl.locals assert repl.locals["context"]["ke...
"value"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_simulated_rlm_completions_functions_not_preserved
assert
string_literal
14
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLSimulatingRLMNoPersistence: def test_simulated_rlm_completions_functions_not_preserved(self): """ Simulates 2 RLM completions to show functions don't persist. """ completion_1_env = LocalREPL() ...
"useful"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_safe_builtins_available
assert
collection
20
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLBuiltins: def test_safe_builtins_available(self): """Test that safe builtins are available.""" repl = LocalREPL() # Test various safe builtins _ = repl.execute_code("x = len([1, 2, 3])") assert...
[1, 2, 3]
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl.py
test_string_context
assert
complex_expr
11
import os from rlm.environments.local_repl import LocalREPL class TestLocalREPLContext: def test_string_context(self): """Test loading string context.""" repl = LocalREPL(context_payload="This is the context data.") assert "context" in
repl.locals
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_add_context_versioning
assert
numeric_literal
14
from rlm.environments.local_repl import LocalREPL class TestLocalREPLMultiContext: def test_add_context_versioning(self): """Test that add_context creates versioned variables.""" repl = LocalREPL() repl.add_context("First", 0) repl.add_context("Second", 1) assert repl.local...
2
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_add_context_auto_increment
assert
numeric_literal
11
from rlm.environments.local_repl import LocalREPL class TestLocalREPLMultiContext: def test_add_context_auto_increment(self): """Test that add_context auto-increments when no index provided.""" repl = LocalREPL() idx1 = repl.add_context("First") idx2 = repl.add_context("Second") ...
0
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_add_context_auto_increment
assert
numeric_literal
12
from rlm.environments.local_repl import LocalREPL class TestLocalREPLMultiContext: def test_add_context_auto_increment(self): """Test that add_context auto-increments when no index provided.""" repl = LocalREPL() idx1 = repl.add_context("First") idx2 = repl.add_context("Second") ...
1
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_contexts_accessible_in_code
assert
string_literal
13
from rlm.environments.local_repl import LocalREPL class TestLocalREPLMultiContext: def test_contexts_accessible_in_code(self): """Test that multiple contexts can be accessed in code execution.""" repl = LocalREPL() repl.add_context("Document A content") repl.add_context("Document B...
""
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_full_persistent_session_simulation
assert
numeric_literal
16
from rlm.environments.local_repl import LocalREPL class TestLocalREPLPersistentState: def test_full_persistent_session_simulation(self): """Simulate a multi-turn persistent session.""" repl = LocalREPL() repl.add_context("Document: Sales were $1000") repl.execute_code("sales = 100...
600
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_context_alias_points_to_first
assert
bool_literal
15
from rlm.environments.local_repl import LocalREPL class TestLocalREPLMultiContext: def test_context_alias_points_to_first(self): """Test that 'context' always aliases context_0.""" repl = LocalREPL() repl.add_context("First") repl.add_context("Second") repl.add_context("Thi...
True
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_local_repl_persistent.py
test_add_context_versioning
assert
string_literal
11
from rlm.environments.local_repl import LocalREPL class TestLocalREPLMultiContext: def test_add_context_versioning(self): """Test that add_context creates versioned variables.""" repl = LocalREPL() repl.add_context("First", 0) repl.add_context("Second", 1) assert repl.loca...
"First"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_context_accumulation_across_calls
assert
numeric_literal
44
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
3
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_history_accumulation_across_calls
assert
numeric_literal
49
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
0
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_variable_persistence_across_completions
assert
numeric_literal
45
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
84
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_variable_persistence_across_completions
assert
numeric_literal
51
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
94
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_local_environment_supported
assert
bool_literal
33
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
True
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_non_persistent_creates_fresh_environment
assert
none_literal
39
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
None
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_default_is_non_persistent
assert
bool_literal
30
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
False
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_environment_reused_in_persistent_mode
assert
variable
45
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
second_env
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_multi_turn_integration.py
test_history_accumulation_across_calls
assert
complex_expr
45
from unittest.mock import Mock, patch import pytest import rlm.core.rlm as rlm_module from rlm import RLM from rlm.core.types import ModelUsageSummary, UsageSummary def create_mock_lm(responses: list[str]) -> Mock: """Create a mock LM that returns responses in order.""" mock = Mock() mock.completion.side...
env.locals
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_parsing.py
test_single_code_block
assert
numeric_literal
24
from unittest.mock import Mock from rlm.core.types import CodeBlock, REPLResult, RLMIteration from rlm.environments.local_repl import LocalREPL from rlm.utils.parsing import ( convert_context_for_repl, find_code_blocks, find_final_answer, format_execution_result, format_iteration, ) class TestFind...
1
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_parsing.py
test_multiple_code_blocks
assert
numeric_literal
27
from unittest.mock import Mock from rlm.core.types import CodeBlock, REPLResult, RLMIteration from rlm.environments.local_repl import LocalREPL from rlm.utils.parsing import ( convert_context_for_repl, find_code_blocks, find_final_answer, format_execution_result, format_iteration, ) class TestFind...
2
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_parsing.py
test_no_code_blocks
assert
collection
19
from unittest.mock import Mock from rlm.core.types import CodeBlock, REPLResult, RLMIteration from rlm.environments.local_repl import LocalREPL from rlm.utils.parsing import ( convert_context_for_repl, find_code_blocks, find_final_answer, format_execution_result, format_iteration, ) class TestFind...
[]
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_parsing.py
test_final_answer
assert
string_literal
19
from unittest.mock import Mock from rlm.core.types import CodeBlock, REPLResult, RLMIteration from rlm.environments.local_repl import LocalREPL from rlm.utils.parsing import ( convert_context_for_repl, find_code_blocks, find_final_answer, format_execution_result, format_iteration, ) class TestFind...
"42"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_parsing.py
test_final_var_without_environment
assert
none_literal
20
from unittest.mock import Mock from rlm.core.types import CodeBlock, REPLResult, RLMIteration from rlm.environments.local_repl import LocalREPL from rlm.utils.parsing import ( convert_context_for_repl, find_code_blocks, find_final_answer, format_execution_result, format_iteration, ) class TestFind...
None
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_parsing.py
test_final_var_retrieves_actual_variables_from_environment
assert
string_literal
47
from unittest.mock import Mock from rlm.core.types import CodeBlock, REPLResult, RLMIteration from rlm.environments.local_repl import LocalREPL from rlm.utils.parsing import ( convert_context_for_repl, find_code_blocks, find_final_answer, format_execution_result, format_iteration, ) class TestFind...
"52"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_to_dict
assert
numeric_literal
27
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestRLMIteration: def test_to_dict(self): result = REPLResult(stdout="", stderr="", locals={}) block = CodeBlock(...
1
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_to_dict
assert
numeric_literal
27
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestRLMMetadata: def test_to_dict(self): meta = RLMMetadata( root_model="gpt-4", max_depth=2, ...
2
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_from_dict
assert
numeric_literal
22
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestModelUsageSummary: def test_from_dict(self): data = { "total_calls": 5, "total_input_tokens":...
5
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_str_representation
assert
variable
18
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestREPLResult: def test_str_representation(self): result = REPLResult(stdout="test", stderr="", locals={}) s = s...
s
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_primitives
assert
numeric_literal
18
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestSerializeValue: def test_primitives(self): assert _serialize_value(None) is None assert _serialize_value(True...
42
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_to_dict
assert
numeric_literal
20
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestModelUsageSummary: def test_to_dict(self): summary = ModelUsageSummary( total_calls=10, total_input_token...
10
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_basic_creation
assert
string_literal
18
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestREPLResult: def test_basic_creation(self): result = REPLResult(stdout="output", stderr="", locals={"x": 1}) a...
""
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_string_prompt
assert
numeric_literal
18
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestQueryMetadata: def test_string_prompt(self): meta = QueryMetadata("Hello, world!") assert meta.context_type =...
13
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_to_dict
assert
numeric_literal
22
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestModelUsageSummary: def test_to_dict(self): summary = ModelUsageSummary( total_calls=10, total_input_token...
500
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_from_dict
assert
numeric_literal
23
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestModelUsageSummary: def test_from_dict(self): data = { "total_calls": 5, "total_input_tokens":...
200
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_from_dict
assert
numeric_literal
24
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestModelUsageSummary: def test_from_dict(self): data = { "total_calls": 5, "total_input_tokens":...
100
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_primitives
assert
none_literal
16
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestSerializeValue: def test_primitives(self): assert _serialize_value(None) is
None
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_primitives
assert
bool_literal
17
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestSerializeValue: def test_primitives(self): assert _serialize_value(None) is None assert _serialize_value(Tru...
True
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_primitives
assert
numeric_literal
19
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestSerializeValue: def test_primitives(self): assert _serialize_value(None) is None assert _serialize_value(True...
3.14
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_string_prompt
assert
collection
19
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestQueryMetadata: def test_string_prompt(self): meta = QueryMetadata("Hello, world!") assert meta.context_type =...
[13]
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alexzhang13/rlm
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
train
train
tests/test_types.py
test_string_prompt
assert
string_literal
17
from rlm.core.types import ( CodeBlock, ModelUsageSummary, QueryMetadata, REPLResult, RLMIteration, RLMMetadata, UsageSummary, _serialize_value, ) class TestQueryMetadata: def test_string_prompt(self): meta = QueryMetadata("Hello, world!") assert meta.context_type ...
"str"
b35a88193e77c43425f32d9ee8be7dcf41d92053
8
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_blueprints.py
test_invalid_decorated_dynamic_limits_blueprint
assert
numeric_literal
28
import datetime import hiro from flask import Blueprint, Flask, current_app from flask_limiter import ExemptionScope, Limiter from flask_limiter.util import get_remote_address def test_invalid_decorated_dynamic_limits_blueprint(caplog): app = Flask(__name__) app.config.setdefault("X", "2 per sec") limite...
3
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_blueprints.py
test_invalid_decorated_static_limit_blueprint
assert
numeric_literal
24
import datetime import hiro from flask import Blueprint, Flask, current_app from flask_limiter import ExemptionScope, Limiter from flask_limiter.util import get_remote_address def test_invalid_decorated_static_limit_blueprint(caplog): app = Flask(__name__) limiter = Limiter(app, default_limits=["1/second"], ...
200
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_blueprints.py
test_invalid_decorated_static_limit_blueprint
assert
numeric_literal
25
import datetime import hiro from flask import Blueprint, Flask, current_app from flask_limiter import ExemptionScope, Limiter from flask_limiter.util import get_remote_address def test_invalid_decorated_static_limit_blueprint(caplog): app = Flask(__name__) limiter = Limiter(app, default_limits=["1/second"], ...
429
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_commands.py
test_no_limiter
assert
complex_expr
17
import os import re import pytest from flask import Flask from flask_limiter.commands import cli def set_env(): os.environ["NO_COLOR"] = "True" def test_no_limiter(kitchensink_factory): app = Flask(__name__) runner = app.test_cli_runner() result = runner.invoke(cli, ["config"]) assert "No Flask...
result.output
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_header_names_config
assert
string_literal
32
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
"1"
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_header_names_config
assert
string_literal
33
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
"0"
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_invalid_config_with_disabled
assert
numeric_literal
33
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
200
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_constructor_arguments_over_config
assert
variable
28
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
MemcachedStorage
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_invalid_strategy
pytest.raises
variable
19
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
ConfigurationError)
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_constructor_arguments_over_config
assert
variable
23
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
MovingWindowRateLimiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_configuration.py
test_header_names_config
assert
func_call
34
import math import time import pytest from flask import Flask from limits.errors import ConfigurationError from limits.storage import MemcachedStorage from limits.strategies import MovingWindowRateLimiter from flask_limiter import HeaderNames from flask_limiter.constants import ConfigVars from flask_limiter.extension...
str(math.ceil(time.time() + 1))
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_decorators.py
test_invalid_decorated_dynamic_limits
assert
numeric_literal
30
import asyncio from functools import wraps from unittest import mock import hiro from flask import Blueprint, Flask, current_app, g, request from werkzeug.exceptions import BadRequest from flask_limiter import ExemptionScope, Limiter def get_ip_from_header(): return request.headers.get("Test-IP") or "127.0.0.1" ...
3
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_decorators.py
test_on_breach_callback
assert
numeric_literal
49
import asyncio from functools import wraps from unittest import mock import hiro from flask import Blueprint, Flask, current_app, g, request from werkzeug.exceptions import BadRequest from flask_limiter import ExemptionScope, Limiter def get_ip_from_header(): return request.headers.get("Test-IP") or "127.0.0.1" ...
1
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_decorators.py
test_invalid_decorated_dynamic_limits
assert
numeric_literal
27
import asyncio from functools import wraps from unittest import mock import hiro from flask import Blueprint, Flask, current_app, g, request from werkzeug.exceptions import BadRequest from flask_limiter import ExemptionScope, Limiter def get_ip_from_header(): return request.headers.get("Test-IP") or "127.0.0.1" ...
200
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_decorators.py
test_invalid_decorated_dynamic_limits
assert
numeric_literal
28
import asyncio from functools import wraps from unittest import mock import hiro from flask import Blueprint, Flask, current_app, g, request from werkzeug.exceptions import BadRequest from flask_limiter import ExemptionScope, Limiter def get_ip_from_header(): return request.headers.get("Test-IP") or "127.0.0.1" ...
429
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_error_handling.py
test_fallback_to_memory_config
assert
numeric_literal
17
import json from unittest.mock import patch import hiro from flask import make_response from flask_limiter.constants import ConfigVars def test_fallback_to_memory_config(redis_connection, extension_factory): _, limiter = extension_factory( config={ConfigVars.ENABLED: True}, default_limits=["5/min...
1
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_error_handling.py
test_fallback_to_memory_with_global_override
assert
numeric_literal
28
import json from unittest.mock import patch import hiro from flask import make_response from flask_limiter.constants import ConfigVars def test_fallback_to_memory_with_global_override(redis_connection, extension_factory): app, limiter = extension_factory( config={ConfigVars.ENABLED: True}, defaul...
200
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_error_handling.py
test_fallback_to_memory
assert
numeric_literal
31
import json from unittest.mock import patch import hiro from flask import make_response from flask_limiter.constants import ConfigVars def test_fallback_to_memory(extension_factory): app, limiter = extension_factory( config={ConfigVars.ENABLED: True}, default_limits=["2/minute"], storage_...
429
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_error_handling.py
test_custom_error_message
assert
string_literal
45
import json from unittest.mock import patch import hiro from flask import make_response from flask_limiter.constants import ConfigVars def test_custom_error_message(extension_factory): app, limiter = extension_factory() @app.errorhandler(429) def ratelimit_handler(e): return make_response(e.desc...
b"uno"
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_error_handling.py
test_custom_error_message
assert
string_literal
49
import json from unittest.mock import patch import hiro from flask import make_response from flask_limiter.constants import ConfigVars def test_custom_error_message(extension_factory): app, limiter = extension_factory() @app.errorhandler(429) def ratelimit_handler(e): return make_response(e.desc...
b"dos"
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_error_handling.py
test_custom_error_message
assert
string_literal
53
import json from unittest.mock import patch import hiro from flask import make_response from flask_limiter.constants import ConfigVars def test_custom_error_message(extension_factory): app, limiter = extension_factory() @app.errorhandler(429) def ratelimit_handler(e): return make_response(e.desc...
b"tres"
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_flask_ext.py
test_logging
assert
numeric_literal
27
import logging import time from collections import Counter from unittest import mock import hiro from flask import Flask, request from werkzeug.exceptions import BadRequest from flask_limiter.constants import ConfigVars from flask_limiter.extension import Limiter from flask_limiter.util import get_remote_address def...
1
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_flask_ext.py
test_default_on_breach_callback
assert
numeric_literal
41
import logging import time from collections import Counter from unittest import mock import hiro from flask import Flask, request from werkzeug.exceptions import BadRequest from flask_limiter.constants import ConfigVars from flask_limiter.extension import Limiter from flask_limiter.util import get_remote_address def...
2
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_flask_ext.py
test_headers_breach
assert
numeric_literal
44
import logging import time from collections import Counter from unittest import mock import hiro from flask import Flask, request from werkzeug.exceptions import BadRequest from flask_limiter.constants import ConfigVars from flask_limiter.extension import Limiter from flask_limiter.util import get_remote_address def...
0
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_flask_ext.py
test_headers_breach
assert
numeric_literal
34
import logging import time from collections import Counter from unittest import mock import hiro from flask import Flask, request from werkzeug.exceptions import BadRequest from flask_limiter.constants import ConfigVars from flask_limiter.extension import Limiter from flask_limiter.util import get_remote_address def...
3
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_flask_ext.py
test_disabled_flag
assert
numeric_literal
30
import logging import time from collections import Counter from unittest import mock import hiro from flask import Flask, request from werkzeug.exceptions import BadRequest from flask_limiter.constants import ConfigVars from flask_limiter.extension import Limiter from flask_limiter.util import get_remote_address def...
200
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_flask_ext.py
test_default_limit_with_exemption
assert
numeric_literal
35
import logging import time from collections import Counter from unittest import mock import hiro from flask import Flask, request from werkzeug.exceptions import BadRequest from flask_limiter.constants import ConfigVars from flask_limiter.extension import Limiter from flask_limiter.util import get_remote_address def...
429
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_regressions.py
test_redis_request_slower_than_fixed_window
assert
string_literal
26
import time import hiro from flask import Blueprint from flask_limiter.constants import ConfigVars def test_redis_request_slower_than_fixed_window(redis_connection, extension_factory): app, limiter = extension_factory( { ConfigVars.DEFAULT_LIMITS: "5 per second", ConfigVars.STORAG...
"5"
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_regressions.py
test_invalid_ratelimit_key
assert
numeric_literal
24
import time import hiro from flask import Blueprint from flask_limiter.constants import ConfigVars def test_invalid_ratelimit_key(extension_factory): app, limiter = extension_factory({ConfigVars.HEADERS_ENABLED: True}) def func(*a): return None @app.route("/t1") @limiter.limit("2/second", k...
200
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_regressions.py
test_invalid_ratelimit_key
assert
numeric_literal
27
import time import hiro from flask import Blueprint from flask_limiter.constants import ConfigVars def test_invalid_ratelimit_key(extension_factory): app, limiter = extension_factory({ConfigVars.HEADERS_ENABLED: True}) def func(*a): return None @app.route("/t1") @limiter.limit("2/second", k...
429
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_regressions.py
test_custom_key_prefix_with_headers
assert
func_call
31
import time import hiro from flask import Blueprint from flask_limiter.constants import ConfigVars def test_custom_key_prefix_with_headers(redis_connection, extension_factory): app1, limiter1 = extension_factory( key_prefix="moo", storage_uri="redis://localhost:46379", headers_enabled=True ) app2...
str(60)
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_storage.py
test_fixed_window
assert
func_call
34
import hiro import pytest def setup(redis_connection, memcached_connection, mongo_connection): redis_connection.flushall() memcached_connection.flush_all() @pytest.mark.parametrize( "storage_uri", [ "memcached://localhost:31211", "redis://localhost:46379", "mongodb://localhost:...
cli.get("/t1").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_storage.py
test_fixed_window
assert
func_call
35
import hiro import pytest def setup(redis_connection, memcached_connection, mongo_connection): redis_connection.flushall() memcached_connection.flush_all() @pytest.mark.parametrize( "storage_uri", [ "memcached://localhost:31211", "redis://localhost:46379", "mongodb://localhost:...
cli.get("/t2").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_views.py
test_pluggable_views
assert
func_call
36
import flask_restful import flask_restx import hiro from flask import request from flask.views import MethodView, View def test_pluggable_views(extension_factory): app, limiter = extension_factory(default_limits=["1/hour"]) class Va(View): methods = ["GET", "POST"] decorators = [limiter.limit(...
cli.get("/a").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_views.py
test_pluggable_views
assert
func_call
39
import flask_restful import flask_restx import hiro from flask import request from flask.views import MethodView, View def test_pluggable_views(extension_factory): app, limiter = extension_factory(default_limits=["1/hour"]) class Va(View): methods = ["GET", "POST"] decorators = [limiter.limit(...
cli.get("/b").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_views.py
test_flask_restful_resource
assert
func_call
55
import flask_restful import flask_restx import hiro from flask import request from flask.views import MethodView, View def test_flask_restful_resource(extension_factory): app, limiter = extension_factory(default_limits=["1/hour"]) api = flask_restful.Api(app) class Va(flask_restful.Resource): deco...
cli.get("/d").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_views.py
test_flask_restx_resource
assert
func_call
26
import flask_restful import flask_restx import hiro from flask import request from flask.views import MethodView, View def test_flask_restx_resource(extension_factory): app, limiter = extension_factory() api = flask_restx.Api(app) ns = api.namespace("test") @ns.route("/a") class Va(flask_restx.Re...
cli.get("/test/a").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
alisaifee/flask-limiter
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
train
train
tests/test_views.py
test_flask_restx_resource
assert
func_call
28
import flask_restful import flask_restx import hiro from flask import request from flask.views import MethodView, View def test_flask_restx_resource(extension_factory): app, limiter = extension_factory() api = flask_restx.Api(app) ns = api.namespace("test") @ns.route("/a") class Va(flask_restx.Re...
cli.post("/test/a").status_code
bc4109dbfef5ac01c43cb98887ac38180cf8fed3
153
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/utils/test_utils.py
test_mapper_1
assert
func_call
32
import asyncio from pydantic import ConfigDict, BaseModel import pytest import pydantic_resolve.utils.class_util import pydantic_resolve.utils.conversion import pydantic_resolve.utils.dataloader @pytest.mark.asyncio async def test_mapper_1(): class A(BaseModel): a: int @pydantic_resolve.utils.convers...
A(a=1)
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/analysis/test_analysis_object_fields_1.py
test_analysis_object_fields
assert
func_call
44
from pydantic import BaseModel from pydantic_resolve.analysis import Analytic from typing import Optional def test_analysis_object_fields(): result = Analytic().scan(Kls) prefix = 'tests.analysis.test_analysis_object_fields_1' expect = { f'{prefix}.Kls': { 'resolve': [], 'ob...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/analysis/test_analysis_object_fields_2.py
test_analysis_object_fields
assert
func_call
34
from pydantic import BaseModel from pydantic_resolve.analysis import Analytic from typing import Optional def test_analysis_object_fields(): result = Analytic().scan(Kls) prefix = 'tests.analysis.test_analysis_object_fields_2' expect = { f'{prefix}.Kls': { 'resolve': [], 'ob...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/analysis/test_analysis_object_fields_3.py
test_long_distance_resolve
assert
func_call
18
from pydantic import BaseModel from pydantic_resolve.analysis import Analytic def test_long_distance_resolve(): result = Analytic().scan(Tree) prefix = 'tests.analysis.test_analysis_object_fields_3' expect = { f'{prefix}.Tree': { 'resolve': [], 'object_fields': [], ...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/analysis/test_analysis_object_fields_4.py
test_long_distance_resolve
assert
func_call
58
from pydantic import BaseModel from pydantic_resolve.analysis import Analytic def test_long_distance_resolve(): result = Analytic().scan(A) prefix = 'tests.analysis.test_analysis_object_fields_4' expect = { f'{prefix}.A': { 'resolve': [], 'post': [], 'object_fiel...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/core/test_field_mix.py
test_get_all_fields
assert
func_call
26
from __future__ import annotations from typing import List from pydantic import BaseModel from pydantic_resolve.analysis import Analytic def test_get_all_fields(): result = Analytic().scan(Student) expect = { 'test_field_mix.Student': { 'resolve': ['resolve_books'], 'post': [], ...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/core/test_field_pydantic.py
test_get_all_fields
assert
func_call
48
from __future__ import annotations from typing import Optional, List from pydantic import BaseModel from pydantic_resolve.analysis import Analytic, convert_metadata_key_as_kls from pydantic_resolve import LoaderDepend async def loader_fn(keys): return keys def test_get_all_fields(): result = Analytic().scan(S...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor
allmonday/pydantic-resolve
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
train
train
tests/core/test_specific_type.py
test_get_all_fields
assert
func_call
24
from __future__ import annotations from typing import Tuple from pydantic import BaseModel from pydantic_resolve.analysis import Analytic async def loader_fn(keys): return keys def test_get_all_fields(): # https://github.com/allmonday/pydantic2-resolve/issues/7 result = Analytic().scan(Student) expect...
v.items()
d776031f79e2cb5ccfc942c1dab52178d400f1ec
107
v2_extractor_at_anchor