MCPcopy Create free account

hub / github.com/AbanteAI/LoCoDiff-bench / functions

Functions81 in github.com/AbanteAI/LoCoDiff-bench

↓ 17 callersFunctionrun_command
Run a shell command and return its output
benchmark_pipeline/generate_example_prompt.py:17
↓ 9 callersFunctionformat_boundary
(x)
benchmark_pipeline/1_generate_prompts.py:698
↓ 4 callersFunctionprint_stats_summary
Prints a summary of statistics for a list of prompts.
benchmark_pipeline/1_generate_prompts.py:947
↓ 3 callersFunction_save_text_file
Helper to save text content to a file, creating parent dirs.
benchmark_pipeline/2_run_benchmark.py:576
↓ 3 callersFunctioncount_tokens
Counts the number of tokens in a given text using the provided encoder. Args: text: The string to count tokens for. encoder:
benchmark_pipeline/1_generate_prompts.py:221
↓ 3 callersFunctionfind_top_performers
Identifies the indices of the top 3 performers in a list of values. Args: values: List of tuples (index, value) to rank Returns
benchmark_pipeline/3_generate_pages.py:183
↓ 3 callersFunctionformat_cell_with_rank
Formats a table cell with medal emoji and border styling if ranked. Args: content: The cell content rank_class: Optional ran
benchmark_pipeline/3_generate_pages.py:229
↓ 3 callersFunctionget_auto_generation_warning
Returns a standard warning about auto-generated files.
benchmark_pipeline/3_generate_pages.py:1117
↓ 3 callersFunctionrun_git_command
Runs a git command and raises exception on error. Args: args: List of arguments for the git command (e.g., ["log", "-1", "--format=%
benchmark_pipeline/1_generate_prompts.py:235
↓ 2 callersFunctioninfer_language_from_filename
Attempts to infer the programming language from a filename or path. Args: filename: The filename or path to analyze ext_to_l
benchmark_pipeline/3_generate_pages.py:250
↓ 2 callersFunctionread_json_file
Reads a JSON file and returns the parsed content.
benchmark_pipeline/3_generate_pages.py:78
↓ 2 callersFunctionsanitize_filename
Removes characters that are problematic for filenames/paths.
benchmark_pipeline/2_run_benchmark.py:424
↓ 2 callersFunctiontruncate_case_name
Extracts just the filename from a path, discarding directory information. Args: name: The case name or path Returns: Ju
benchmark_pipeline/3_generate_pages.py:3825
↓ 1 callersFunction_get_async_openai_client
Initializes and returns the async OpenAI client for OpenRouter.
benchmark_pipeline/2_run_benchmark.py:107
↓ 1 callersFunction_get_latest_run_info
Finds the latest run directory for a case/model and returns its path and cost. # Helper function for checking existing results. Returns:
benchmark_pipeline/2_run_benchmark.py:876
↓ 1 callersFunctionbuild_extension_to_language_map
Creates a reverse map from extension to language.
benchmark_pipeline/1_generate_prompts.py:457
↓ 1 callersFunctionbuild_prompt_content
Constructs the prompt content using the git history.
benchmark_pipeline/1_generate_prompts.py:361
↓ 1 callersFunctioncalculate_prompt_statistics
Calculates token statistics globally and per language, including quartile distribution. Args: prompt_infos: A list of PromptInfo obj
benchmark_pipeline/1_generate_prompts.py:574
↓ 1 callersFunctionclone_repo_to_cache
Clone a GitHub repository into the cached-repos directory. Args: repo_name: A GitHub repository name, either as a full URL (https://
benchmark_pipeline/1_generate_prompts.py:129
↓ 1 callersFunctioncollect_prompt_metadata
Collects metadata for all prompts in the prompts directory. Args: prompts_dir: Path to the directory containing prompts and their me
benchmark_pipeline/3_generate_pages.py:318
↓ 1 callersFunctioncollect_results_metadata
Collects result metadata for all benchmark cases and models. Args: results_dir: Path to the directory containing benchmark results
benchmark_pipeline/3_generate_pages.py:367
↓ 1 callersFunctioncompute_openai_cost
Compute OpenAI cost for GPT-5 using provided pricing. Returns: (cost_openai, input_tokens, output_tokens)
benchmark_pipeline/update_costs_openai_pass_through.py:62
↓ 1 callersFunctioncopy_selected_files
Copies selected prompt and expected output files from temporary directory to the final prompts directory. Args: kept_prefixes: A set
benchmark_pipeline/1_generate_prompts.py:1066
↓ 1 callersFunctioncopy_static_assets
Copies static assets to the docs directory.
benchmark_pipeline/3_generate_pages.py:62
↓ 1 callersFunctioncreate_cases_section
Creates a section with links to model-specific benchmark case pages.
benchmark_pipeline/3_generate_pages.py:1949
↓ 1 callersFunctioncreate_chart_javascript
Creates JavaScript code for initializing and controlling the chart.
benchmark_pipeline/3_generate_pages.py:1321
↓ 1 callersFunctioncreate_css_file
Creates a basic CSS stylesheet for the GitHub Pages site.
benchmark_pipeline/3_generate_pages.py:3029
↓ 1 callersFunctioncreate_example_section
Creates an HTML section explaining the benchmark with a git merge conflict example.
benchmark_pipeline/3_generate_pages.py:1217
↓ 1 callersFunctioncreate_html_footer
Creates the HTML footer. Args: include_chart_js: Whether to include the chart JavaScript code. Returns: HTML string for
benchmark_pipeline/3_generate_pages.py:505
↓ 1 callersFunctioncreate_html_header
Creates the HTML header with basic metadata and CSS link.
benchmark_pipeline/3_generate_pages.py:482
↓ 1 callersFunctioncreate_key_takeaways_section
Creates a section highlighting key findings from the benchmark.
benchmark_pipeline/3_generate_pages.py:1303
↓ 1 callersFunctioncreate_language_stats_table
Creates an HTML table showing success rates by programming language. Args: results_metadata: Dictionary mapping (case_prefix, model)
benchmark_pipeline/3_generate_pages.py:866
↓ 1 callersFunctioncreate_locodiff_summary
Creates a summary section describing LoCoDiff and Mentat's role. Returns: HTML string for the summary section
benchmark_pipeline/3_generate_pages.py:453
↓ 1 callersFunctioncreate_quartile_stats_table
Creates an HTML table showing success rates by prompt size quartiles. Args: results_metadata: Dictionary mapping (case_prefix, model
benchmark_pipeline/3_generate_pages.py:721
↓ 1 callersFunctioncreate_token_chart_section
Creates an HTML section for the token-based chart.
benchmark_pipeline/3_generate_pages.py:1146
↓ 1 callersFunctiondelete_and_recreate_dir
Completely removes a directory and recreates it empty.
benchmark_pipeline/3_generate_pages.py:54
↓ 1 callersFunctiondetermine_prompt_quartiles
Determines the token count ranges for each quartile. Args: prompt_tokens_list: List of token counts for all prompts Returns:
benchmark_pipeline/3_generate_pages.py:88
↓ 1 callersFunctiondetermine_quartile
Determines which quartile a token count falls into. Args: token_count: The token count to classify quartile_ranges: List of
benchmark_pipeline/3_generate_pages.py:138
↓ 1 callersFunctionextract_code_from_backticks
Extracts content between the first and the last triple backticks (```). Handles optional language identifiers after the first backticks and s
benchmark_pipeline/2_run_benchmark.py:433
↓ 1 callersFunctionfilter_prompts_by_token_range
Filters the list of generated prompt statistics based on prompt token limits. Args: stats_list: The initial list of statistics for a
benchmark_pipeline/1_generate_prompts.py:959
↓ 1 callersFunctionfind_benchmark_cases
Finds all unique benchmark case prefixes defined in the benchmark metadata (located in prompts_dir). Falls back to scanning prompts_dir if me
benchmark_pipeline/2_run_benchmark.py:492
↓ 1 callersFunctiongenerate_actual_output_page
Generates a page displaying the raw model response. Args: case_prefix: The benchmark case prefix model: The model name
benchmark_pipeline/3_generate_pages.py:2123
↓ 1 callersFunctiongenerate_case_page
Generates a page for a specific benchmark case and model. Args: case_prefix: The benchmark case prefix model: The model name
benchmark_pipeline/3_generate_pages.py:2803
↓ 1 callersFunctiongenerate_cases_overview_page
Generates a page showing all benchmark cases with their results across all models. Args: prompt_metadata: Dictionary of prompt metad
benchmark_pipeline/3_generate_pages.py:2292
↓ 1 callersFunctiongenerate_chart_data
Generates raw case data for the token-based chart. Instead of pre-calculating buckets, provides the raw case data for JavaScript to proc
benchmark_pipeline/3_generate_pages.py:1030
↓ 1 callersFunctiongenerate_expected_output_page
Generates a page displaying just the expected output content. Args: case_prefix: The benchmark case prefix model: The model
benchmark_pipeline/3_generate_pages.py:2057
↓ 1 callersFunctiongenerate_model_page
Generates a page for a specific model showing all its benchmark cases. Args: model: The model name prompt_metadata: Dictiona
benchmark_pipeline/3_generate_pages.py:2625
↓ 1 callersFunctiongenerate_prompt_page
Generates a page displaying just the prompt content. Args: case_prefix: The benchmark case prefix model: The model name
benchmark_pipeline/3_generate_pages.py:1991
↓ 1 callersFunctiongenerate_prompts_and_expected
Generates prompts and expected outputs for eligible files in a repository. Iterates through files matching specified extensions, applies dat
benchmark_pipeline/1_generate_prompts.py:760
↓ 1 callersFunctionget_all_extensions_from_config
Extracts a set of all unique extensions from the language config.
benchmark_pipeline/1_generate_prompts.py:447
↓ 1 callersFunctionget_detailed_existing_prompt_info
Scans the prompts directory, reads each prompt, counts tokens, and infers language. Args: prompts_dir: Directory containing the '*_p
benchmark_pipeline/1_generate_prompts.py:482
↓ 1 callersFunctionget_generation_stats_openrouter
Queries the OpenRouter Generation Stats API asynchronously for cost and token information. Args: generation_id: The ID of the genera
benchmark_pipeline/2_run_benchmark.py:256
↓ 1 callersFunctionget_git_history
Gets the full git log history with patches for a file.
benchmark_pipeline/1_generate_prompts.py:300
↓ 1 callersFunctionget_git_numstat
Gets the total lines added and deleted for a file from git history.
benchmark_pipeline/1_generate_prompts.py:312
↓ 1 callersFunctionget_model_response_openrouter
Sends a prompt to a specified model via OpenRouter asynchronously. Args: prompt_content: The full content of the prompt to send to t
benchmark_pipeline/2_run_benchmark.py:125
↓ 1 callersFunctionget_repo_head_commit_hash
Get the HEAD commit hash of a repository. Args: repo_path: Path to the cloned repository. Returns: The full commit hash
benchmark_pipeline/1_generate_prompts.py:180
↓ 1 callersFunctionis_file_recently_modified
Checks if a file was modified after the threshold timestamp. Args: rel_path: Relative path of the file within the repository.
benchmark_pipeline/1_generate_prompts.py:263
↓ 1 callersFunctionis_gpt5_model_dir_name
Check if a sanitized model directory name corresponds to openai/gpt-5*. We store model directory names sanitized with '/' -> '_', so:
benchmark_pipeline/update_costs_openai_pass_through.py:50
↓ 1 callersFunctionload_benchmark_config
Loads the benchmark configuration including language mappings and model display names. Args: config_path: Path to the configuration
benchmark_pipeline/3_generate_pages.py:276
↓ 1 callersFunctionload_example_git_history
Loads the example git history and expected output from files. Returns: Tuple of (git_history, expected_output)
benchmark_pipeline/3_generate_pages.py:1184
↓ 1 callersFunctionload_existing_metadata_and_prefixes
Loads existing metadata and identifies all existing benchmark case prefixes from the prompts directory. Args: prompts_dir: The direc
benchmark_pipeline/1_generate_prompts.py:1132
↓ 1 callersFunctionload_language_config
Loads language configuration from a YAML file. Args: filepath: Path to the YAML configuration file. Returns: A dictiona
benchmark_pipeline/1_generate_prompts.py:394
↓ 1 callersFunctionmain
()
benchmark_pipeline/1_generate_prompts.py:1286
↓ 1 callersFunctionmain
()
benchmark_pipeline/update_costs_openai_pass_through.py:144
↓ 1 callersFunctionmain
()
benchmark_pipeline/generate_example_prompt.py:164
↓ 1 callersFunctionmain
()
benchmark_pipeline/2_run_benchmark.py:928
↓ 1 callersFunctionmain
()
benchmark_pipeline/3_generate_pages.py:3839
↓ 1 callersFunctionprint_detailed_prompt_stats
Prints the calculated prompt statistics in a formatted way.
benchmark_pipeline/1_generate_prompts.py:690
↓ 1 callersFunctionrun_single_benchmark
Runs a single benchmark case asynchronously, handling errors and saving metadata. Args: benchmark_case_prefix: The unique identifier
benchmark_pipeline/2_run_benchmark.py:586
↓ 1 callersFunctionsample_prompts
Samples prompts from the filtered list to meet the num_prompts target. Uses targeted sampling to aim for distribution across the token range.
benchmark_pipeline/1_generate_prompts.py:994
↓ 1 callersFunctionsave_benchmark_metadata
Appends the current generation run's metadata to the list of existing runs and saves the updated list to metadata.json. Args: ex
benchmark_pipeline/1_generate_prompts.py:1217
↓ 1 callersFunctionsave_output
Save the git log and final file state to files in the benchmark directory
benchmark_pipeline/generate_example_prompt.py:144
↓ 1 callersFunctionsetup_repo
Set up a temporary git repository
benchmark_pipeline/generate_example_prompt.py:23
↓ 1 callersFunctionstandardize_repo_name
Convert various GitHub repository reference formats to a standard 'org/repo' format. Args: repo_name: A GitHub repository name, eith
benchmark_pipeline/1_generate_prompts.py:96
↓ 1 callersFunctionupdate_metadata_file
Update a single metadata.json file. Returns True if updated, False if skipped.
benchmark_pipeline/update_costs_openai_pass_through.py:86
↓ 1 callersFunctionwrite_chart_data_to_file
Writes chart data to a JSON file in the specified directory.
benchmark_pipeline/3_generate_pages.py:1126
↓ 1 callersFunctionwrite_output_files
Writes the prompt and expected output content to their respective files.
benchmark_pipeline/1_generate_prompts.py:344
Functioncreate_overall_stats_table
Creates an HTML table showing overall statistics for each model. Args: results_metadata: Dictionary mapping (case_prefix, model) to
benchmark_pipeline/3_generate_pages.py:597
Functioncreate_table_of_contents
Creates a table of contents section for the main page. Returns: HTML string for the table of contents section
benchmark_pipeline/3_generate_pages.py:429
Functionparse_success_rate
Extracts success rate percentage from a cell content string. Args: cell_content: String containing success rate info (e.g. "24.50% (
benchmark_pipeline/3_generate_pages.py:165
Functionwilson_score_interval
Calculate Wilson score interval for a binomial proportion. This is used to compute confidence intervals for success rates. Args:
benchmark_pipeline/3_generate_pages.py:993