benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf aaa41102-66a4-5886-9d11-4fdcd255752f

Problem

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

complete prompt

from dateutil.parser import parse
from datetime import timedelta


def task_func(date_str):
    """
    Get the next business day (Mon-Fri) after a certain date string. Implemented by dateutil.parser and datetime.

    Parameters:
    date_str (str): The date string in "yyyy-mm-dd" format.

    Returns:
    datetime: The datetime object of the next business day.

    Requirements:
    - datetime
    - dateutil.parser

    Example:
    >>> task_func('2022-10-22')
    datetime.datetime(2022, 10, 24, 0, 0)
    >>> task_func('2022-10-28')
    datetime.datetime(2022, 10, 31, 0, 0)
    """

instruct prompt

Get the next business day (Mon-Fri) after a certain date string. Implemented by dateutil.parser and datetime.
The function should output with:
    datetime: The datetime object of the next business day.
You should write self-contained code starting with:

Code

from dateutil.parser import parse
from datetime import timedelta
def task_func(date_str):

code prompt

Code

from dateutil.parser import parse
from datetime import timedelta
def task_func(date_str):

entry point

task_func

libs

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