SYMBOL INDEX (221 symbols across 35 files) FILE: scripts/benchmark_e2b.py function benchmark_code_reward (line 33) | def benchmark_code_reward(example): FILE: scripts/decontaminate.py function normalize_string (line 36) | def normalize_string(text: str) -> str: function word_ngrams (line 45) | def word_ngrams(text: str, n: int) -> list: function build_ngram_lookup (line 51) | def build_ngram_lookup(documents: list[str], ngram_size: int = 8) -> dic... function build_ngram_single (line 64) | def build_ngram_single(document: str, ngram_size: int = 8) -> set[str]: function find_contaminated (line 118) | def find_contaminated(row): function cleanup (line 127) | def cleanup(dataset: Dataset) -> Dataset: FILE: scripts/e2b_router.py class BatchRequest (line 32) | class BatchRequest(BaseModel): class ScriptResult (line 47) | class ScriptResult(BaseModel): function create_app (line 66) | def create_app(args): function parse_args (line 139) | def parse_args(): FILE: scripts/generate_reasoning.py function generate_completion (line 21) | async def generate_completion(session, prompt, args): function process_example (line 45) | async def process_example(example, session, args, output_file, pbar): function load_processed_uuids (line 91) | async def load_processed_uuids(output_file, uuid_column): function main (line 104) | async def main(): FILE: scripts/get_tensor_parallel_size.py function get_tensor_parallel_size (line 5) | def get_tensor_parallel_size(model_name: str, revision: str = None, defa... FILE: scripts/morph_router.py class BatchRequest (line 28) | class BatchRequest(BaseModel): class ScriptResult (line 43) | class ScriptResult(BaseModel): function create_app (line 59) | def create_app(args): function parse_args (line 143) | def parse_args(): FILE: scripts/pass_rate_filtering/compute_pass_rate.py class PassRateScriptArguments (line 38) | class PassRateScriptArguments(GRPOScriptArguments): function main (line 48) | def main(script_args, training_args, model_args): FILE: scripts/run_benchmarks.py class ScriptArguments (line 23) | class ScriptArguments: function main (line 39) | def main(): FILE: scripts/upload_details.py class ScriptArguments (line 34) | class ScriptArguments: function main (line 40) | def main(): FILE: setup.py function deps_list (line 88) | def deps_list(*pkgs): FILE: src/open_r1/configs.py class DatasetConfig (line 23) | class DatasetConfig: class DatasetMixtureConfig (line 34) | class DatasetMixtureConfig: class ScriptArguments (line 43) | class ScriptArguments(trl.ScriptArguments): method __post_init__ (line 78) | def __post_init__(self): class GRPOConfig (line 125) | class GRPOConfig(trl.GRPOConfig): class SFTConfig (line 170) | class SFTConfig(trl.SFTConfig): class GRPOScriptArguments (line 209) | class GRPOScriptArguments(ScriptArguments): FILE: src/open_r1/generate.py function build_distilabel_pipeline (line 23) | def build_distilabel_pipeline( FILE: src/open_r1/grpo.py function main (line 35) | def main(script_args, training_args, model_args): FILE: src/open_r1/rewards.py function accuracy_reward (line 40) | def accuracy_reward(completions: list[list[dict[str, str]]], solution: l... function format_reward (line 85) | def format_reward(completions, **kwargs): function tag_count_reward (line 93) | def tag_count_reward(completions, **kwargs) -> list[float]: function reasoning_steps_reward (line 115) | def reasoning_steps_reward(completions, **kwargs): function len_reward (line 132) | def len_reward(completions: list[Dict[str, str]], solution: list[str], *... function get_cosine_scaled_reward (line 205) | def get_cosine_scaled_reward( function get_repetition_penalty_reward (line 285) | def get_repetition_penalty_reward(ngram_size: int, max_penalty: float, l... function _init_event_loop (line 357) | def _init_event_loop(): function ioi_code_reward (line 367) | def ioi_code_reward(completions, test_batch_size: int = 1, provider_type... function cf_code_reward (line 420) | def cf_code_reward( function extract_code (line 476) | def extract_code(completion: str, language: str | None = "python") -> str: function binary_code_reward (line 485) | def binary_code_reward( function code_reward (line 511) | def code_reward( function get_code_format_reward (line 595) | def get_code_format_reward(language: str = "python"): function get_soft_overlong_punishment (line 620) | def get_soft_overlong_punishment(max_completion_len, soft_punish_cache): function get_reward_funcs (line 646) | def get_reward_funcs(script_args) -> list[Callable]: FILE: src/open_r1/sft.py function main (line 55) | def main(script_args, training_args, model_args): FILE: src/open_r1/utils/callbacks.py function is_slurm_available (line 28) | def is_slurm_available() -> bool: class DummyConfig (line 37) | class DummyConfig: method __init__ (line 38) | def __init__(self, **kwargs): class PushToHubRevisionCallback (line 43) | class PushToHubRevisionCallback(TrainerCallback): method __init__ (line 44) | def __init__(self, model_config) -> None: method on_save (line 47) | def on_save( function get_callbacks (line 85) | def get_callbacks(train_config, model_config) -> List[TrainerCallback]: FILE: src/open_r1/utils/code_providers.py class CodeExecutionProvider (line 46) | class CodeExecutionProvider(abc.ABC): method execute_scripts (line 50) | def execute_scripts(self, scripts: List[str], languages: List[str]) ->... class E2BProvider (line 63) | class E2BProvider(CodeExecutionProvider): method __init__ (line 66) | def __init__(self, num_parallel: int = 2, e2b_router_url: Optional[str... method execute_scripts (line 82) | def execute_scripts(self, scripts: List[str], languages: List[str]) ->... method _run_async_from_sync (line 115) | def _run_async_from_sync(self, scripts: List[str], languages: List[str... method _run_async (line 125) | async def _run_async(self, scripts: List[str], languages: List[str], n... method _run_script (line 135) | async def _run_script(self, script: str, languages: List[str], semapho... class MorphProvider (line 169) | class MorphProvider(CodeExecutionProvider): method __init__ (line 172) | def __init__(self, num_parallel: int = 2, morph_router_url: Optional[s... method execute_scripts (line 211) | def execute_scripts(self, scripts: List[str], languages: List[str]) ->... method _run_async (line 253) | async def _run_async(self, scripts: List[str], languages: List[str], n... method _run_script (line 273) | async def _run_script(self, script: str, languages: List[str], semapho... function get_provider (line 339) | def get_provider(provider_type: str = "e2b", **kwargs) -> CodeExecutionP... FILE: src/open_r1/utils/competitive_programming/cf_scoring.py function score_single_test_case (line 12) | async def score_single_test_case( function get_generated_contest_tests (line 59) | async def get_generated_contest_tests(contest_id: str) -> list[dict]: function get_generated_tests (line 89) | async def get_generated_tests(problem_id: str) -> list[dict]: function score_submission (line 94) | async def score_submission( FILE: src/open_r1/utils/competitive_programming/code_patcher.py function fix_python3_imports (line 4) | def fix_python3_imports(source_code): function fix_cpp_includes (line 76) | def fix_cpp_includes(source_code): function is_patchable (line 85) | def is_patchable(lang): function patch_code (line 89) | def patch_code(text, lang): FILE: src/open_r1/utils/competitive_programming/ioi_scoring.py class TestResult (line 11) | class TestResult: class SubtaskResult (line 29) | class SubtaskResult: method status (line 50) | def status(self): method score (line 62) | def score(self): method weighted_score (line 76) | def weighted_score(self): method to_dict (line 91) | def to_dict(self): function _extract_single_status (line 110) | def _extract_single_status(score: float, feedback: str) -> str: function score_single_test_case (line 138) | async def score_single_test_case( function score_subtask (line 164) | async def score_subtask( function score_subtasks (line 246) | async def score_subtasks( function run_submission (line 267) | async def run_submission( function execute_ioi (line 302) | async def execute_ioi(client, data) -> tuple[str, str]: FILE: src/open_r1/utils/competitive_programming/ioi_utils.py function add_includes (line 7) | def add_includes(code: str, problem_id: str) -> str: function load_ioi_tests_for_year (line 26) | def load_ioi_tests_for_year(year: int) -> dict[str, dict[str, tuple[str,... function load_ioi_tests (line 37) | def load_ioi_tests(year: int, problem_id: str) -> dict[str, tuple[str, s... FILE: src/open_r1/utils/competitive_programming/morph_client.py class MorphCloudError (line 26) | class MorphCloudError(Exception): class MorphCloudExecutionClient (line 30) | class MorphCloudExecutionClient: method __init__ (line 31) | def __init__( method _prepare_instance (line 49) | async def _prepare_instance(self, snapshot_id=None) -> Instance: method _prepare_files (line 82) | async def _prepare_files(self, data: Dict[str, Any], temp_dir: str) ->... method _upload_files (line 139) | async def _upload_files(self, instance: Instance, local_files: Dict[st... method _compile_code (line 166) | async def _compile_code(self, instance: Instance) -> InstanceExecRespo... method _run_tests (line 186) | async def _run_tests(self, instance: Instance, data: Dict[str, Any]) -... method _execute_with_instance (line 222) | async def _execute_with_instance(self, instance: Instance, data: Dict[... method _execute (line 250) | async def _execute(self, data: Dict[str, Any]) -> Tuple[str, str]: method execute (line 282) | async def execute(self, data: Dict[str, Any]) -> Tuple[str, str]: method _get_or_create_base_snapshot (line 337) | async def _get_or_create_base_snapshot(self): method _get_compile_script (line 408) | async def _get_compile_script(self): method _get_run_script (line 485) | async def _get_run_script(self): function get_morph_client_from_env (line 715) | def get_morph_client_from_env(session=None) -> MorphCloudExecutionClient: FILE: src/open_r1/utils/competitive_programming/piston_client.py class PistonError (line 12) | class PistonError(Exception): function get_piston_client_from_env (line 17) | def get_piston_client_from_env(session=None): class PistonClient (line 36) | class PistonClient: method __init__ (line 59) | def __init__( method session (line 82) | def session(self): method _wait_for_endpoint (line 94) | async def _wait_for_endpoint(self): method _release_endpoint (line 98) | async def _release_endpoint(self, endpoint): method _send_request (line 101) | async def _send_request(self, endpoint, route, data=None, method="post"): method _send_to_all (line 107) | async def _send_to_all(self, route, data=None, method="post"): method _send_to_one (line 112) | async def _send_to_one(self, endpoint, route, data=None, method="post"): method install_package (line 115) | async def install_package(self, language, version): method uninstall_package (line 118) | async def uninstall_package(self, language, version): method get_supported_runtimes (line 121) | async def get_supported_runtimes(self): method _check_failed_endpoint (line 124) | async def _check_failed_endpoint(self, endpoint): method send_execute (line 137) | async def send_execute(self, data, language="cms_ioi", max_retries=5): function get_slurm_piston_endpoints (line 201) | def get_slurm_piston_endpoints(): FILE: src/open_r1/utils/competitive_programming/utils.py function batched (line 4) | def batched(iterable, n): FILE: src/open_r1/utils/data.py function get_dataset (line 12) | def get_dataset(args: ScriptArguments) -> DatasetDict: FILE: src/open_r1/utils/evaluation.py function register_lighteval_task (line 27) | def register_lighteval_task( function get_lighteval_tasks (line 62) | def get_lighteval_tasks(): function run_lighteval_job (line 69) | def run_lighteval_job( function run_benchmark_jobs (line 106) | def run_benchmark_jobs(training_args: Union["SFTConfig", "GRPOConfig"], ... FILE: src/open_r1/utils/hub.py function push_to_hub_revision (line 39) | def push_to_hub_revision(training_args: SFTConfig | GRPOConfig, extra_ig... function check_hub_revision_exists (line 70) | def check_hub_revision_exists(training_args: SFTConfig | GRPOConfig): function get_param_count_from_repo_id (line 89) | def get_param_count_from_repo_id(repo_id: str) -> int: function get_gpu_count_for_vllm (line 121) | def get_gpu_count_for_vllm(model_name: str, revision: str = "main", num_... FILE: src/open_r1/utils/import_utils.py function is_e2b_available (line 22) | def is_e2b_available() -> bool: function is_morph_available (line 29) | def is_morph_available() -> bool: FILE: src/open_r1/utils/model_utils.py function get_tokenizer (line 9) | def get_tokenizer(model_args: ModelConfig, training_args: SFTConfig | GR... function get_model (line 23) | def get_model(model_args: ModelConfig, training_args: SFTConfig | GRPOCo... FILE: src/open_r1/utils/routed_morph.py class RoutedMorphSandbox (line 21) | class RoutedMorphSandbox: method __init__ (line 35) | def __init__(self, router_url: str, timeout: int = 300, request_timeou... method run_code (line 48) | def run_code( FILE: src/open_r1/utils/routed_sandbox.py class RoutedSandbox (line 22) | class RoutedSandbox: method __init__ (line 32) | def __init__(self, router_url: str): method run_code (line 41) | def run_code( FILE: src/open_r1/utils/wandb_logging.py function init_wandb_training (line 4) | def init_wandb_training(training_args): FILE: tests/slow/test_code_reward.py class TestCodeRewards (line 26) | class TestCodeRewards(unittest.TestCase): method test_python_code_reward (line 27) | def test_python_code_reward(self): method test_e2b_router (line 38) | def test_e2b_router(self): method test_e2b_router_parallel (line 49) | def test_e2b_router_parallel(self): method test_ioi_code_reward (line 74) | def test_ioi_code_reward(self): method test_e2b_router_run_code_success (line 87) | def test_e2b_router_run_code_success(self): method test_e2b_router_run_code_with_error (line 105) | def test_e2b_router_run_code_with_error(self): method test_python_code_reward_morph (line 127) | def test_python_code_reward_morph(self): method test_morph_router (line 141) | def test_morph_router(self): method test_morph_router_parallel (line 156) | def test_morph_router_parallel(self): method test_morph_router_run_code_success (line 183) | def test_morph_router_run_code_success(self): method test_morph_router_run_code_with_error (line 200) | def test_morph_router_run_code_with_error(self): FILE: tests/test_rewards.py class TestGetRewardFuncs (line 37) | class TestGetRewardFuncs(unittest.TestCase): method test_get_reward_funcs (line 38) | def test_get_reward_funcs(self): class TestRewards (line 78) | class TestRewards(unittest.TestCase): method test_accuracy_reward_correct_answer (line 79) | def test_accuracy_reward_correct_answer(self): method test_accuracy_reward_wrong_answer (line 86) | def test_accuracy_reward_wrong_answer(self): method test_accuracy_reward_wrong_answer_no_latex (line 93) | def test_accuracy_reward_wrong_answer_no_latex(self): method test_format_reward_correct (line 100) | def test_format_reward_correct(self): method test_format_reward_incorrect (line 106) | def test_format_reward_incorrect(self): method test_reasoning_steps_reward (line 121) | def test_reasoning_steps_reward(self): method test_multiple_completions (line 139) | def test_multiple_completions(self): method test_cosine_scaled_reward (line 152) | def test_cosine_scaled_reward(self): method test_format_reward_specific_multiline (line 200) | def test_format_reward_specific_multiline(self): method test_same_length_responses (line 207) | def test_same_length_responses(self): method test_different_lengths_correct_answers (line 218) | def test_different_lengths_correct_answers(self): method test_different_lengths_incorrect_answers (line 230) | def test_different_lengths_incorrect_answers(self): method test_mixed_correctness (line 243) | def test_mixed_correctness(self): method test_unparseable_solution (line 270) | def test_unparseable_solution(self): class TestRepetitionPenaltyReward (line 283) | class TestRepetitionPenaltyReward(unittest.TestCase): method test_positive_max_penalty_raises_value_error (line 284) | def test_positive_max_penalty_raises_value_error(self): method test_no_repetition (line 290) | def test_no_repetition(self): method test_full_repetition (line 296) | def test_full_repetition(self): method test_partial_repetition (line 304) | def test_partial_repetition(self): method test_multiple_completions (line 313) | def test_multiple_completions(self): method test_empty_completion (line 326) | def test_empty_completion(self): method test_different_ngram_size (line 332) | def test_different_ngram_size(self): method test_mixed_case (line 339) | def test_mixed_case(self): method test_one_word_completion (line 350) | def test_one_word_completion(self): method test_two_word_completion (line 357) | def test_two_word_completion(self): method test_three_word_completion (line 364) | def test_three_word_completion(self): method test_three_word_repetition_completion (line 371) | def test_three_word_repetition_completion(self): method test_four_word_completion_with_repetition (line 378) | def test_four_word_completion_with_repetition(self): method test_five_word_completion_with_repetition (line 386) | def test_five_word_completion_with_repetition(self): method test_six_word_completion_with_repetition (line 394) | def test_six_word_completion_with_repetition(self): method test_long_completion_with_repetition (line 401) | def test_long_completion_with_repetition(self): method test_long_completion_without_repetition (line 407) | def test_long_completion_without_repetition(self): method test_tag_count_rewards_all_correct (line 414) | def test_tag_count_rewards_all_correct(self): method test_tag_count_rewards_missing_think_begin (line 420) | def test_tag_count_rewards_missing_think_begin(self): method test_tag_count_rewards_missing_think_end (line 426) | def test_tag_count_rewards_missing_think_end(self): method test_tag_count_rewards_missing_answer_begin (line 432) | def test_tag_count_rewards_missing_answer_begin(self): method test_tag_count_rewards_missing_answer_end (line 438) | def test_tag_count_rewards_missing_answer_end(self): method test_tag_count_rewards_missing_all_tags (line 444) | def test_tag_count_rewards_missing_all_tags(self): method test_full_repetition_with_language (line 450) | def test_full_repetition_with_language(self): method test_soft_overlong_punishment_short_completion (line 461) | def test_soft_overlong_punishment_short_completion(self): method test_soft_overlong_punishment_long_completion (line 469) | def test_soft_overlong_punishment_long_completion(self): method test_soft_overlong_punishment_intermediate_completion (line 477) | def test_soft_overlong_punishment_intermediate_completion(self): class TestCodeFormat (line 485) | class TestCodeFormat(unittest.TestCase): method test_correct_python_format (line 486) | def test_correct_python_format(self): method test_incorrect_formats (line 499) | def test_incorrect_formats(self): method test_multiple_code_blocks (line 520) | def test_multiple_code_blocks(self): method test_different_languages (line 533) | def test_different_languages(self): method test_multiline_code (line 553) | def test_multiline_code(self): FILE: tests/utils/test_data.py class TestGetDataset (line 23) | class TestGetDataset(unittest.TestCase): method setUpClass (line 25) | def setUpClass(cls): method test_dataset_and_config_name (line 30) | def test_dataset_and_config_name(self): method test_unweighted_mixture (line 37) | def test_unweighted_mixture(self): method test_weighted_mixture (line 52) | def test_weighted_mixture(self): method test_mixture_and_test_split (line 69) | def test_mixture_and_test_split(self): method test_mixture_column_selection (line 85) | def test_mixture_column_selection(self): method test_mixture_with_mismatched_columns (line 106) | def test_mixture_with_mismatched_columns(self): method test_no_dataset_name_or_mixture (line 122) | def test_no_dataset_name_or_mixture(self):