benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf c4130e3c-0727-59e8-bace-8c6e5d773516

Problem

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

complete prompt

from collections import defaultdict from random import randint def task_func(dict1): """ Create a dictionary of employee data for departments starting with 'EMP$$'. The keys are department codes and the values are lists of the salaries of employees in that department. Parameters: dict1 (dict): A dictionary with department codes as keys and number of employees as values. Returns: dict: A dictionary with department codes starting with 'EMP$$' as keys and lists of employee salaries as values. Requirements: - collections - random Example: >>> import random >>> random.seed(0) >>> d = {'EMP$$1': 10, 'MAN$$1': 5, 'EMP$$2': 8, 'HR$$1': 7} >>> emp_data = task_func(d) >>> print(emp_data.keys()) dict_keys(['EMP$$1', 'EMP$$2']) """
Plain-text mathematical notation (without MathML)
from collections import defaultdict
from random import randint

def task_func(dict1):
    """
    Create a dictionary of employee data for departments starting with 'EMP$$'. 
    The keys are department codes and the values are lists of the salaries of employees in that department.
    
    Parameters:
    dict1 (dict): A dictionary with department codes as keys and number of employees as values.
    
    Returns:
    dict: A dictionary with department codes starting with 'EMP$$' as keys and lists of employee salaries as values.
    
    Requirements:
    - collections
    - random
    
    Example:
    >>> import random
    >>> random.seed(0)
    >>> d = {'EMP$$1': 10, 'MAN$$1': 5, 'EMP$$2': 8, 'HR$$1': 7}
    >>> emp_data = task_func(d)
    >>> print(emp_data.keys())
    dict_keys(['EMP$$1', 'EMP$$2'])
    """
Original LaTeX notation
from collections import defaultdict
from random import randint

def task_func(dict1):
    """
    Create a dictionary of employee data for departments starting with 'EMP$$'. 
    The keys are department codes and the values are lists of the salaries of employees in that department.
    
    Parameters:
    dict1 (dict): A dictionary with department codes as keys and number of employees as values.
    
    Returns:
    dict: A dictionary with department codes starting with 'EMP$$' as keys and lists of employee salaries as values.
    
    Requirements:
    - collections
    - random
    
    Example:
    >>> import random
    >>> random.seed(0)
    >>> d = {'EMP$$1': 10, 'MAN$$1': 5, 'EMP$$2': 8, 'HR$$1': 7}
    >>> emp_data = task_func(d)
    >>> print(emp_data.keys())
    dict_keys(['EMP$$1', 'EMP$$2'])
    """

instruct prompt

Create a dictionary of employee data for departments starting with 'EMP$$'. The keys are department codes and the values are lists of the salaries of employees in that department. The function should output with: dict: A dictionary with department codes starting with 'EMP$$' as keys and lists of employee salaries as values. You should write self-contained code starting with:
Plain-text mathematical notation (without MathML)
Create a dictionary of employee data for departments starting with 'EMP$$'. The keys are department codes and the values are lists of the salaries of employees in that department.
The function should output with:
    dict: A dictionary with department codes starting with 'EMP$$' as keys and lists of employee salaries as values.
You should write self-contained code starting with:
Original LaTeX notation
Create a dictionary of employee data for departments starting with 'EMP$$'. The keys are department codes and the values are lists of the salaries of employees in that department.
The function should output with:
    dict: A dictionary with department codes starting with 'EMP$$' as keys and lists of employee salaries as values.
You should write self-contained code starting with:

Code

from collections import defaultdict
from random import randint
def task_func(dict1):

code prompt

Code

from collections import defaultdict
from random import randint
def task_func(dict1):

entry point

task_func

libs

  • collections
  • random

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