benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 2e25c992-59da-51e4-ac8d-00e83dc99126

Problem

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

complete prompt

from datetime import datetime
import random
import matplotlib.pyplot as plt


def task_func(date_str):
    """
    Generates a list of random integers, where the count of integers equals the day of the month in the
    provided date, then generates a line plot of these integers and returns the Axes object of the plot.

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

    Returns:
    - matplotlib.axes.Axes: The Axes object containing the plot.

    Requirements:
    - datetime.datetime
    - random
    - matplotlib.pyplot

    Example:
    >>> ax = task_func('2023-06-15')
    >>> type(ax)
    <class 'matplotlib.axes._axes.Axes'>
    """

instruct prompt

Generates a list of random integers, where the count of integers equals the day of the month in the provided date, then generates a line plot of these integers and returns the Axes object of the plot.
The function should output with:
    matplotlib.axes.Axes: The Axes object containing the plot.
You should write self-contained code starting with:

Code

from datetime import datetime
import random
import matplotlib.pyplot as plt
def task_func(date_str):

code prompt

Code

from datetime import datetime
import random
import matplotlib.pyplot as plt
def task_func(date_str):

entry point

task_func

libs

  • datetime
  • random
  • matplotlib

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