benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 7dc73ea7-6422-53ad-9ae2-f3bd8bd7c8b7

Problem

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

complete prompt

import collections
import json
import requests

def task_func(user, API_URL = 'https://api.github.com/users/'):
    """
    Retrieves the names of the repositories of a specified GitHub user, sorted in ascending order by their creation date.

    The function queries the GitHub API for all repositories of a given user, parses the response to extract the names and creation dates, and returns the repository names sorted by the date they were created.

    Parameters:
    - user (str): The GitHub username whose repositories are to be retrieved.
    - API_URL (str): The base URL of the GitHub API. Default is 'https://api.github.com/users/'.

    Returns:
    - list of str: A list of repository names, sorted by their creation dates from oldest to newest.


    Requirements:
    - collections
    - json
    - requests

    Example:
    >>> task_func('octocat')
    ['Spoon-Knife', 'Hello-World', 'octocat.github.io']  # Example output, actual results may vary.
    """

instruct prompt

Retrieves the names of the repositories of a specified GitHub user, sorted in ascending order by their creation date. The function queries the GitHub API for all repositories of a given user, parses the response to extract the names and creation dates, and returns the repository names sorted by the date they were created.
The function should output with:
    list of str: A list of repository names, sorted by their creation dates from oldest to newest.
You should write self-contained code starting with:

Code

import collections
import json
import requests
def task_func(user, API_URL = 'https://api.github.com/users/'):

code prompt

Code

import collections
import json
import requests
def task_func(user, API_URL = 'https://api.github.com/users/'):

entry point

task_func

libs

  • collections
  • requests
  • json

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