benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 64bfc7bd-8706-5596-a166-e27daeef4cf9

Problem

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

complete prompt

from django.http import HttpResponse
import uuid

def task_func(data):
    """
    Create a Django HttpResponse with JSON data, and include a UUID in the HTTP headers to track requests.

    Parameters:
    data (str): The JSON-formatted data to be included in the response body.

    Returns:
    HttpResponse: A Django HttpResponse with JSON data and UUID.
    
    Requirements:
    - django
    - uuid

    Example:
    >>> import json
    >>> response = task_func(json.dumps({"Sample-Key": "Sample-Value"}))
    >>> response.has_key('UUID')
    True
    """

instruct prompt

Create a Django HttpResponse with JSON data, and include a UUID in the HTTP headers to track requests.
The function should output with:
    HttpResponse: A Django HttpResponse with JSON data and UUID.
You should write self-contained code starting with:

Code

from django.http import HttpResponse
import uuid
def task_func(data):

code prompt

Code

from django.http import HttpResponse
import uuid
def task_func(data):

entry point

task_func

libs

  • uuid
  • django

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