benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 43b1a54c-3ba8-56e0-a844-d65b04bacbe2

Problem

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

complete prompt

from texttable import Texttable
import os
import psutil

def task_func():
    """
    Generates a table displaying the system's CPU usage, memory usage, and disk usage.

    Returns:
        A string representation of a table with the columns of 'Item' and 'Value',
        and the following system information:
        - CPU Usage (%)
        - Memory Usage (%)
        - Disk Usage (%)

    Requirements:
    - texttable.Texttable
    - os
    - psutil

    Examples:
    >>> table_str = task_func()
    >>> isinstance(table_str, str)
    True
    >>> 'CPU Usage (%)' in table_str and 'Memory Usage (%)' in table_str
    True
    """

instruct prompt

Generates a table displaying the system's CPU usage, memory usage, and disk usage.
The function should output with:
    A string representation of a table with the columns of 'Item' and 'Value',
    and the following system information:
    CPU Usage (%)
    Memory Usage (%)
    Disk Usage (%)
You should write self-contained code starting with:

Code

from texttable import Texttable
import os
import psutil
def task_func():

code prompt

Code

from texttable import Texttable
import os
import psutil
def task_func():

entry point

task_func

libs

  • psutil
  • texttable
  • 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