benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 85d49322-a5e6-5aa3-857d-50e4831e66bf

Problem

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

complete prompt

from collections import Counter
import math

def task_func(nested_dict):
    """
    Aggregate the values of the same keys from a nested dictionary and remove the "ele" key. For each remaining key take the sine.
    
    Parameters:
    - nested_dict (dict): The nested dictionary. Default is NESTED_DICT constant.
    
    Returns:
    - dict: A dictionary with aggregated values.

    Requirements:
    - math
    - collections

    Example:
    >>> task_func({
    ...     'dict1': {'ale': 1, 'ele': 2, 'ile': 3},
    ...     'dict2': {'ele': 4, 'ole': 5, 'ule': 6},
    ...     'dict3': {'ile': 7, 'ale': 8, 'ele': 9}
    ... })
    {'ale': 0.4121184852417566, 'ile': -0.5440211108893698, 'ole': -0.9589242746631385, 'ule': -0.27941549819892586}
    """

instruct prompt

Aggregate the values of the same keys from a nested dictionary and remove the "ele" key. For each remaining key take the sine.
The function should output with:
    dict: A dictionary with aggregated values.
You should write self-contained code starting with:

Code

from collections import Counter
import math
def task_func(nested_dict):

code prompt

Code

from collections import Counter
import math
def task_func(nested_dict):

entry point

task_func

libs

  • math
  • collections

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