benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 97ca8158-d152-546a-a04c-6d5b1eb6dbba

Problem

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

complete prompt

from collections import Counter
import re

def task_func(result):
    """
    Get the most common values associated with the url key in the dictionary list "result."

    Parameters:
    result (list): A list of dictionaries.

    Returns:
    dict: A dictionary with the most common values and their counts.

    Requirements:
    - collections
    - re

    Example:
    >>> result = [{"hi": 7, "http://google.com": 0}, {"https://google.com": 0}, {"http://www.cwi.nl": 1}]
    >>> task_func(result)
    {0: 2}
    """

instruct prompt

Get the most common values associated with the url key in the dictionary list "result."
The function should output with:
    dict: A dictionary with the most common values and their counts.
You should write self-contained code starting with:

Code

from collections import Counter
import re
def task_func(result):

code prompt

Code

from collections import Counter
import re
def task_func(result):

entry point

task_func

libs

  • collections
  • re

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