benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 3b7b9a49-74f4-5ddd-87d6-dc7e19b368a3

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

# Constants
ARCHIVE_DIR = '/tmp/archive'

def task_func(pattern):
    """
    Archive all files that match a particular pattern and then delete the original files.
    
    Parameters:
    - pattern (str): The pattern to match files.
    
    Returns:
    - archive_file (str): The archive file path.
    
    Requirements:
    - subprocess
    - os
    - glob
    
    Example:
    >>> task_func('*.txt')
    
    Note: This function will return the archive file path.
    """

instruct prompt

Archive all files that match a particular pattern and then delete the original files.
Note that: This function will return the archive file path.
The function should output with:
    archive_file (str): The archive file path.
You should write self-contained code starting with:

Code

import subprocess
import os
import glob
# Constants
ARCHIVE_DIR = '/tmp/archive'
def task_func(pattern):

code prompt

Code

import subprocess
import os
import glob
# Constants
ARCHIVE_DIR = '/tmp/archive'
def task_func(pattern):

entry point

task_func

libs

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