benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf ea6e502a-84ec-5621-b343-674bce86a8a8

Problem

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

complete prompt

import re
import requests

def task_func(input):
    """
    Extract an API endpoint from the input string, send a GET request to the endpoint, and return the response data in JSON format.

    Parameters:
    input (str): The input string containing an API endpoint.

    Returns:
    dict: The response data.

    Requirements:
    - re
    - json
    - requests

    Example:
    >>> task_func('Fetch data from https://api.example.com/data')
    {'key': 'value'}
    """

instruct prompt

Extract an API endpoint from the input string, send a GET request to the endpoint, and return the response data in JSON format.
The function should output with:
    dict: The response data.
You should write self-contained code starting with:

Code

import re
import requests
def task_func(input):

code prompt

Code

import re
import requests
def task_func(input):

entry point

task_func

libs

  • re
  • 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