benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 481d9346-562c-5551-a17b-12200c86ab05

Problem

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

complete prompt

import collections
import itertools
import matplotlib.pyplot as plt

# Constants
ITEMS = ['apple', 'banana']


def task_func(a, b, items=ITEMS):
    """
    Combine two lists and record the frequency of predefined items in the combined list.

    Parameters:
    a (list): A list of items.
    b (list): Another list of items.
    items (list, optional): a list of predefined items

    Returns:
    matplotlib.axes.Axes: A bar chart showing the frequency of predefined items in the combined list.

    Requirements:
    - collections
    - itertools
    - matplotlib.pyplot

    Example:
    >>> ax = task_func(['apple', 'banana', 'cherry'], ['date', 'elderberry', 'apple', 'banana', 'cherry'])
    >>> isinstance(ax, matplotlib.axes.Axes)
    True
    """

instruct prompt

Combine two lists and record the frequency of predefined items in the combined list.
The function should output with:
    matplotlib.axes.Axes: A bar chart showing the frequency of predefined items in the combined list.
You should write self-contained code starting with:

Code

import collections
import itertools
import matplotlib.pyplot as plt
# Constants
ITEMS = ['apple', 'banana']
def task_func(a, b, items=ITEMS):

code prompt

Code

import collections
import itertools
import matplotlib.pyplot as plt
# Constants
ITEMS = ['apple', 'banana']
def task_func(a, b, items=ITEMS):

entry point

task_func

libs

  • matplotlib
  • collections
  • itertools

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