benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 2b5d7969-0589-5049-bb37-5991262495d2

Problem

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

complete prompt

import os
import ctypes
from datetime import datetime
import pytz

def task_func(filepath):
    """
    Loads a DLL file from the specified filepath and returns its metadata, including creation time,
    modification time, and file size. The times are displayed in UTC format. This function
    demonstrates the use of ctypes for loading DLLs and os module for accessing file metadata.

    
    Parameters:
    filepath (str): The path of the DLL file.

    Returns:
    str: The name of the loaded DLL file.
    dict: A dictionary containing the metadata of the DLL file, including the keys 'Creation Time', 'Modification Time', and 'Size'.
    
    Requirements:
    - ctypes
    - os
    - datetime.datetime
    - pytz

    Examples:
    >>> isinstance(task_func('libc.so.6'), str) # Doctest will vary based on the system and DLL file availability.
    True
    >>> 'libc.so.6' in task_func('libc.so.6')
    True
    """

instruct prompt

Loads a DLL file from the specified filepath and returns its metadata, including creation time, modification time, and file size. The times are displayed in UTC format. This function demonstrates the use of ctypes for loading DLLs and os module for accessing file metadata.
The function should output with:
    str: The name of the loaded DLL file.
    dict: A dictionary containing the metadata of the DLL file, including the keys 'Creation Time', 'Modification Time', and 'Size'.
You should write self-contained code starting with:

Code

import os
import ctypes
from datetime import datetime
import pytz
def task_func(filepath):

code prompt

Code

import os
import ctypes
from datetime import datetime
import pytz
def task_func(filepath):

entry point

task_func

libs

  • pytz
  • ctypes
  • os
  • datetime

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