benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 5d16166b-903c-526a-8921-7e2b1030e563

Problem

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

complete prompt

import json
import csv
import os
import base64

def task_func(raw_string, filename, output_dir):
    """
    Processes a base64-encoded JSON string, stores the data in a CSV file, and returns the path of the file.

    Parameters:
    - raw_string (str): The base64 encoded JSON string.
    - filename (str): The name of the file to which the data should be saved (without extension).
    - output_dir (str): The path of the directory in which the file should be saved.

    Returns:
    - file_path (str): The path of the file.

    Requirements:
    - json
    - csv
    - os
    - base64

    Example:
    >>> task_func('eyJrZXkiOiAiVmFsdWUifQ==', 'data', './output')
    './output/data.csv'
    """

instruct prompt

Processes a base64-encoded JSON string, stores the data in a CSV file, and returns the path of the file.
The function should output with:
    file_path (str): The path of the file.
You should write self-contained code starting with:

Code

import json
import csv
import os
import base64
def task_func(raw_string, filename, output_dir):

code prompt

Code

import json
import csv
import os
import base64
def task_func(raw_string, filename, output_dir):

entry point

task_func

libs

  • csv
  • base64
  • os
  • 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