# BigCodeBench / 

task_id: d5448d1c-9244-5a08-8687-06229ee478b5
task_key: default--v0~2e1~2e0~5fhf--d5448d1c-9244-5a08-8687-06229ee478b5
task_revision_id: 1

{"code_prompt":"import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm\ndef task_func(n_samples=1000, mu=0, sigma=1, random_seed=0):\n","complete_prompt":"import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm\n\n\ndef task_func(n_samples=1000, mu=0, sigma=1, random_seed=0):\n    \"\"\"\n    Generates a histogram and a probability density function (PDF) plot for a specified normal distribution.\n\n    This function draws n_samples from a normal distribution defined by mean (mu) and standard deviation (sigma),\n    plots a histogram of the samples, and overlays the PDF of the normal distribution. The histogram's density\n    is normalized, and the PDF is plotted with a red line with linewidth=2.\n\n    Parameters:\n    - n_samples (int): Number of samples for the histogram. Must be greater than 0. Default is 1000.\n    - mu (float): Mean for the normal distribution. Default is 0.\n    - sigma (float): Standard deviation for the normal distribution. Must be greater than 0. Default is 1.\n    - random_seed (int): Random seed for reproducibility. Defaults to 0.\n\n    Returns:\n    - ax (matplotlib.axes._axes.Axes): Axes object with the histogram and PDF plotted.\n    - samples (numpy.ndarray): Generated sample data.\n\n    Requirements:\n    - numpy\n    - matplotlib.pyplot\n    - scipy.stats.norm\n\n    Example:\n    >>> ax, samples = task_func()\n    >>> type(ax)\n    <class 'matplotlib.axes._axes.Axes'>\n    >>> ax.get_xticklabels()\n    [Text(-5.0, 0, '−5'), Text(-4.0, 0, '−4'), Text(-3.0, 0, '−3'), Text(-2.0, 0, '−2'), Text(-1.0, 0, '−1'), Text(0.0, 0, '0'), Text(1.0, 0, '1'), Text(2.0, 0, '2'), Text(3.0, 0, '3'), Text(4.0, 0, '4'), Text(5.0, 0, '5')]\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Generates a histogram and a probability density function (PDF) plot for a specified normal distribution. This function draws n_samples from a normal distribution defined by mean (mu) and standard deviation (sigma), plots a histogram of the samples, and overlays the PDF of the normal distribution. The histogram's density is normalized, and the PDF is plotted with a red line with linewidth=2.\nThe function should output with:\n    ax (matplotlib.axes._axes.Axes): Axes object with the histogram and PDF plotted.\n    samples (numpy.ndarray): Generated sample data.\nYou should write self-contained code starting with:\n```\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm\ndef task_func(n_samples=1000, mu=0, sigma=1, random_seed=0):\n```","libs":"['numpy', 'matplotlib', 'scipy']"}

Source: https://bigcode-bench.github.io/

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=d5448d1c-9244-5a08-8687-06229ee478b5&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
