# BigCodeBench / 

task_id: f83c4190-8a56-5682-b889-27cb6245d18d
task_key: default--v0~2e1~2e0~5fhf--f83c4190-8a56-5682-b889-27cb6245d18d
task_revision_id: 1

{"code_prompt":"import numpy as np\nimport matplotlib.pyplot as plt\n# Constants\nNUM_SAMPLES = 100\nNUM_OUTLIERS = 5\ndef task_func(num_samples=NUM_SAMPLES, num_outliers=NUM_OUTLIERS):\n","complete_prompt":"import numpy as np\nimport matplotlib.pyplot as plt\n\n# Constants\nNUM_SAMPLES = 100\nNUM_OUTLIERS = 5\n\n\ndef task_func(num_samples=NUM_SAMPLES, num_outliers=NUM_OUTLIERS):\n    \"\"\"\n    Generate a dataset comprising both normal data and artificially introduced outliers,\n    and plot a histogram of the combined data. The function detects outliers in the dataset\n    using the Interquartile Range (IQR) method, but it only considers the normally distributed\n    portion of the data for outlier detection. The outliers detected and the artificially\n    introduced outliers might not always coincide.\n\n    Parameters:\n    - num_samples (int): Number of samples to be drawn from a normal distribution. The default \n      value is 100. If set to zero or a negative number, no normal data will be generated, \n      and the dataset will only contain artificially introduced outliers.\n    - num_outliers (int): Number of outliers to be artificially introduced into the dataset. \n      These outliers are uniformly distributed between -10 and 10. The default value is 5. \n      If set to zero, no outliers will be artificially introduced.\n\n\n    Returns:\n    - data (numpy array): The combined dataset, including both normally distributed data and \n      the artificially introduced outliers.\n    - outliers_detected (numpy array): The outliers detected using the IQR method. This \n      detection is based solely on the normally distributed portion of the data.\n    - ax (matplotlib.axes._axes.Axes): The Axes object for the histogram \n      plot of the combined dataset.\n\n    Requirements:\n    - numpy\n    - matplotlib\n\n    Note:\n    - The artificially introduced outliers are not necessarily the same as the outliers\n    detected by the IQR method. The IQR method is applied only to the normally distributed\n    data, and thus some of the artificially introduced outliers may not be detected,\n    and some normal data points may be falsely identified as outliers.\n\n    Example:\n    >>> import numpy as np\n    >>> np.random.seed(0)\n    >>> data, outliers_detected, ax = task_func()\n    >>> print(outliers_detected)\n    [-9.61613603 -3.96850367  3.20347075]\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Generate a dataset comprising both normal data and artificially introduced outliers, and plot a histogram of the combined data. The function detects outliers in the dataset using the Interquartile Range (IQR) method, but it only considers the normally distributed portion of the data for outlier detection. The outliers detected and the artificially introduced outliers might not always coincide.\nNote that: The artificially introduced outliers are not necessarily the same as the outliers detected by the IQR method. The IQR method is applied only to the normally distributed data, and thus some of the artificially introduced outliers may not be detected, and some normal data points may be falsely identified as outliers.\nThe function should output with:\n    data (numpy array): The combined dataset, including both normally distributed data and\n    the artificially introduced outliers.\n    outliers_detected (numpy array): The outliers detected using the IQR method. This\n    detection is based solely on the normally distributed portion of the data.\n    ax (matplotlib.axes._axes.Axes): The Axes object for the histogram\n    plot of the combined dataset.\nYou should write self-contained code starting with:\n```\nimport numpy as np\nimport matplotlib.pyplot as plt\n# Constants\nNUM_SAMPLES = 100\nNUM_OUTLIERS = 5\ndef task_func(num_samples=NUM_SAMPLES, num_outliers=NUM_OUTLIERS):\n```","libs":"['numpy', 'matplotlib']"}

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

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=f83c4190-8a56-5682-b889-27cb6245d18d&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
