benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 9f0b97a9-dcbf-569d-bf0e-4882f770f6cc

Problem

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

complete prompt

import os
import os.path
import csv
import collections


# Constants
FILE_NAME = 'file_sizes.csv'

def task_func(my_path):
    """
    Create a report on the file size in a directory and write it to a CSV file.

    Parameters:
    my_path (str): The directory path.

    Returns:
    str: The path of the CSV file.

    Requirements:
    - os
    - os.path
    - csv
    - collections

    Example:
    >>> task_func('/usr/my_directory')
    """

instruct prompt

Create a report on the file size in a directory and write it to a CSV file.
The function should output with:
    str: The path of the CSV file.
You should write self-contained code starting with:

Code

import os
import os.path
import csv
import collections
# Constants
FILE_NAME = 'file_sizes.csv'
def task_func(my_path):

code prompt

Code

import os
import os.path
import csv
import collections
# Constants
FILE_NAME = 'file_sizes.csv'
def task_func(my_path):

entry point

task_func

libs

  • csv
  • collections
  • 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