benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf c2680da3-46c5-54c6-8502-9452dcff1a4a

Problem

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

complete prompt

import subprocess
import time
import threading


def task_func(file_list):
    """
    Run files from list of files as subprocesses at the same time.
    
    Parameters:
    - file_list (list of str): List of files name to run.

    Returns:
    list: The exit codes of the subprocesses.

    Requirements:
    - subprocess
    - time
    - threading

    Example:
    >>> task_func(["task_func_data/file1.bat", "task_func_data/file2.bat"])
    [0, 0]
    """

instruct prompt

Run files from list of files as subprocesses at the same time.
The function should output with:
    list: The exit codes of the subprocesses.
You should write self-contained code starting with:

Code

import subprocess
import time
import threading
def task_func(file_list):

code prompt

Code

import subprocess
import time
import threading
def task_func(file_list):

entry point

task_func

libs

  • subprocess
  • threading
  • 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