benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf e58f0375-0632-5e6f-a9d8-6d4cd9e01f3e

Problem

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

complete prompt

import math
from random import randint
import matplotlib.pyplot as plt


def task_func():
    """
    Create and draw a sine wave with random frequency, amplitude and phase shift. The return ax object
    has 'Random Sine Wave' title, 'Time' on the x axis and 'Amplitude' on the y axis.

    Parameters:
    None

    Returns:
    ax (matplotlib.axes._axes.Axes): The axis object of the generated sine wave plot.

    Requirements:
    - math
    - random
    - matplotlib.pyplot

    Example:
    >>> ax = task_func()
    """

instruct prompt

Create and draw a sine wave with random frequency, amplitude and phase shift. The return ax object has 'Random Sine Wave' title, 'Time' on the x axis and 'Amplitude' on the y axis.
The function should output with:
    ax (matplotlib.axes._axes.Axes): The axis object of the generated sine wave plot.
You should write self-contained code starting with:

Code

import math
from random import randint
import matplotlib.pyplot as plt
def task_func():

code prompt

Code

import math
from random import randint
import matplotlib.pyplot as plt
def task_func():

entry point

task_func

libs

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