benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 9d7bd28e-4427-5c83-a42f-acaf232315cd

Problem

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

complete prompt

import os
from flask_mail import Mail

def task_func(app):
    """
    Initialize a Flask application with Flask-Mail. 

    Parameters:
    app (Flask): The Flask application to configure.

    Returns:
    tuple: A tuple containing the Flask-Mail instance and the app's mail configurations.

    Note:
    - The details of the email server are retrieved from environment variables. 
    - If the variables do not exist, use defaults.
    
    Requirements:
    - os
    - flask_mail

    Example:
    >>> from flask import Flask
    >>> app = Flask("test")
    >>> mail, configs = task_func(app)
    >>> 'MAIL_SERVER' in configs
    True
    """

instruct prompt

Initialize a Flask application with Flask-Mail.
Note that: The details of the email server are retrieved from environment variables. If the variables do not exist, use defaults.
The function should output with:
    tuple: A tuple containing the Flask-Mail instance and the app's mail configurations.
You should write self-contained code starting with:

Code

import os
from flask_mail import Mail
def task_func(app):

code prompt

Code

import os
from flask_mail import Mail
def task_func(app):

entry point

task_func

libs

  • flask_mail
  • 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