benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 11e25664-b5c6-560c-9c5d-2a92520b108f

Problem

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

complete prompt

import unicodedata
import requests

URL = 'https://api.github.com/users/'

def task_func(username):
    """
    Retrieves user information from the GitHub API for a given username, normalizes all string data to ASCII,
    and returns a dictionary of the normalized data. This function demonstrates data retrieval from a web API
    and handling of Unicode data normalization.

    Parameters:
    username (str): The GitHub username.

    Returns:
    dict: A dictionary with the user's data, where all string values are normalized to ASCII.

    Raises:
    requests.exceptions.HTTPError: For any HTTP response indicating an error.

    Requirements:
    - unicodedata
    - requests

    Examples:
    >>> result = task_func('torvalds')
    >>> isinstance(result, dict)
    True
    >>> 'login' in result
    True
    """

instruct prompt

Retrieves user information from the GitHub API for a given username, normalizes all string data to ASCII, and returns a dictionary of the normalized data. This function demonstrates data retrieval from a web API and handling of Unicode data normalization.
The function should raise the exception for: requests.exceptions.HTTPError: For any HTTP response indicating an error.
The function should output with:
    dict: A dictionary with the user's data, where all string values are normalized to ASCII.
You should write self-contained code starting with:

Code

import unicodedata
import requests
URL = 'https://api.github.com/users/'
def task_func(username):

code prompt

Code

import unicodedata
import requests
URL = 'https://api.github.com/users/'
def task_func(username):

entry point

task_func

libs

  • unicodedata
  • requests

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