benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf cfb6a37a-5976-5ce9-8a47-4747e9068df5

Problem

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

complete prompt

import os
from datetime import datetime

def task_func(filepath: str) -> dict:
    """
    Determine the size and date of the last modification of a file.

    Parameters:
    - filepath (str): The path to the file.

    Returns:
    - dict: A dictionary containing the size (in bytes) and last modification 
          date of the file in the format '%Y-%m-%d %H:%M:%S'.

    Requirements:
    - os
    - datetime

    Example:
    >>> task_func('/path/to/file.txt')
    {'size': '1024 bytes', 'last_modified': '2022-01-01 12:30:45'}
    """

instruct prompt

Determine the size and date of the last modification of a file.
The function should output with:
    dict: A dictionary containing the size (in bytes) and last modification
    date of the file in the format '%Y-%m-%d %H:%M:%S'.
You should write self-contained code starting with:

Code

import os
from datetime import datetime
def task_func(filepath: str) -> dict:

code prompt

Code

import os
from datetime import datetime
def task_func(filepath: str) -> dict:

entry point

task_func

libs

  • datetime
  • 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