benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 2cba0eab-b31a-53f4-a416-33c2bb64e3a2

Problem

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

complete prompt

import subprocess
import os
import glob
import time


def task_func(test_dir):
    """
    Run all Python codes in a specific directory and return their execution times.

    Parameters:
    - script_path (str): Path to the directory for Python code(s) to be executed.
    
    Returns:
    dict: A dictionary with the script names as keys and their execution times as values.

    Requirements:
    - subprocess
    - os
    - glob
    - time

    Example:
    >>> task_func("/mnt/data/mix_files/")
    {'script1.py': 0.04103803634643555, "script2.py": 5}
    """

instruct prompt

Run all Python codes in a specific directory and return their execution times.
The function should output with:
    dict: A dictionary with the script names as keys and their execution times as values.
You should write self-contained code starting with:

Code

import subprocess
import os
import glob
import time
def task_func(test_dir):

code prompt

Code

import subprocess
import os
import glob
import time
def task_func(test_dir):

entry point

task_func

libs

  • glob
  • subprocess
  • os
  • time

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