benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf 75913fe0-9ae0-5108-9bb3-eb678432fc17
Problem
Answer published by the source. Consult the official source to check your work against its answer.
complete prompt
import json
from datetime import datetime
def task_func(json_data):
"""
Determine if the given datetime is a weekend.
Parameters:
- json_data (str): JSON string containing the datetime in UTC format.
Returns:
bool: True if the date is a weekend (Saturday or Sunday), False otherwise.
Note:
- The datetime to be extracted is located in the 'utc_datetime' key in the JSON data.
Requirements:
- json
- datetime
Example:
>>> json_data = '{"utc_datetime": "2024-04-19T12:00:00"}'
>>> task_func(json_data)
False
"""
instruct prompt
Determine if the given datetime is a weekend.
Note that: The datetime to be extracted is located in the 'utc_datetime' key in the JSON data.
The function should output with:
bool: True if the date is a weekend (Saturday or Sunday), False otherwise.
You should write self-contained code starting with:
Code
import json
from datetime import datetime
def task_func(json_data):
code prompt
Code
import json
from datetime import datetime
def task_func(json_data):
entry point
task_func
libs
- datetime
- json
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
initial import