benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 4db7dd57-c650-5fd5-87d5-ef8578280ee4

Problem

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

complete prompt

import math
import yaml

def task_func(yaml_path, key):
    """
    Read a YAML file, apply the cosine to a specific key from the data, and then write the modified data back into the YAML file.
    
    Parameters:
    - yaml_path (str): The path to the YAML file.
    - key (str): The key to take the cosine of.
    
    Returns:
    - data (dict): A dictionary representation of the modified YAML data.

    Requirements:
    - math
    - yaml
    
    Example:
    >>> yaml_data = task_func('data.yaml', 'ele')
    """

instruct prompt

Read a YAML file, apply the cosine to a specific key from the data, and then write the modified data back into the YAML file.
The function should output with:
    data (dict): A dictionary representation of the modified YAML data.
You should write self-contained code starting with:

Code

import math
import yaml
def task_func(yaml_path, key):

code prompt

Code

import math
import yaml
def task_func(yaml_path, key):

entry point

task_func

libs

  • math
  • yaml

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