benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 203fe064-4362-507b-b62a-e56a9b5b8625

Problem

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

complete prompt

import shutil
import os
import fnmatch
import itertools

def task_func(src_dir, dst_dir):
    """
    Copy all files from 'src_dir' to 'dst_dir' that match any pattern in ['*.txt', '*.docx'].

    Parameters:
    - src_dir (str): The source directory.
    - dst_dir (str): The destination directory.

    Returns:
    - str: The destination directory.
    
    Requirements:
    - shutil
    - os
    - fnmatch
    - itertools

    Example:
    >>> task_func('./source', './destination')
    >>> './destination'
    """

instruct prompt

Copy all files from 'src_dir' to 'dst_dir' that match any pattern in ['*.txt', '*.docx'].
The function should output with:
    str: The destination directory.
You should write self-contained code starting with:

Code

import shutil
import os
import fnmatch
import itertools
def task_func(src_dir, dst_dir):

code prompt

Code

import shutil
import os
import fnmatch
import itertools
def task_func(src_dir, dst_dir):

entry point

task_func

libs

  • shutil
  • itertools
  • fnmatch
  • 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