benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf cee72af9-3672-5349-8131-dbbbb37a952f

Problem

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

complete prompt

import subprocess
import random

# Constants
SCRIPTS = ['script1.sh', 'script2.sh', 'script3.sh']
SCRIPTS_DIR = '/path/to/scripts'  

def task_func():
    """
    Run a random bash script from a list of scripts.

    Parameters:
    - None

    Returns:
    - script (str): The full path of the script that was executed.

    Requirements:
    - subprocess
    - random

    Example:
    >>> task_func()
    """

instruct prompt

Run a random bash script from a list of scripts.
The function should output with:
    script (str): The full path of the script that was executed.
You should write self-contained code starting with:

Code

import subprocess
import random
# Constants
SCRIPTS = ['script1.sh', 'script2.sh', 'script3.sh']
SCRIPTS_DIR = '/path/to/scripts'  
def task_func():

code prompt

Code

import subprocess
import random
# Constants
SCRIPTS = ['script1.sh', 'script2.sh', 'script3.sh']
SCRIPTS_DIR = '/path/to/scripts'  
def task_func():

entry point

task_func

libs

  • subprocess
  • random

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