benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf bdd61db1-e918-5f69-b5ec-c273d7530755

Problem

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

complete prompt

import base64
import os


def task_func():
    """
    Generates a random float number, converts it to a hexadecimal string,
    and then encodes this hexadecimal representation in base64.

    Returns:
        str: The base64 encoded string of the hexadecimal representation of a random float.

    Requirements:
        - os
        - base64

    Example:
    >>> example_output = task_func()
    >>> isinstance(example_output, str)
    True
    >>> len(example_output) > 0
    True
    """

instruct prompt

Generates a random float number, converts it to a hexadecimal string, and then encodes this hexadecimal representation in base64.
The function should output with:
    str: The base64 encoded string of the hexadecimal representation of a random float.
You should write self-contained code starting with:

Code

import base64
import os
def task_func():

code prompt

Code

import base64
import os
def task_func():

entry point

task_func

libs

  • base64
  • os

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