benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 2159125b-001f-52a3-bfce-27a1aa629823

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import os
import json

def task_func(config_path: str) -> dict:
    """
    Load a JSON configuration file and return the configuration dictionary.
    
    Parameters:
    - config_path (str): Path to the configuration file.
    
    Returns:
    - config (dict): Configuration dictionary loaded from the file.
    
    Requirements:
    - os
    - json
    
    Raises:
    - FileNotFoundError: If the provided configuration file does not exist.
    
    Example:
    >>> task_func("config.json")
    {'key': 'value', 'setting': True}
    """

instruct prompt

Load a JSON configuration file and return the configuration dictionary.
The function should raise the exception for: FileNotFoundError: If the provided configuration file does not exist.
The function should output with:
    config (dict): Configuration dictionary loaded from the file.
You should write self-contained code starting with:

Code

import os
import json
def task_func(config_path: str) -> dict:

code prompt

Code

import os
import json
def task_func(config_path: str) -> dict:

entry point

task_func

libs

  • json
  • os

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import