<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def engine_from_environment() -> Engine: """Returns an Engine instance configured using environment variables. If the environment variables are set, but incorrect, an authentication failure will occur when attempting to run jobs on the engine. Required Environment Variables: QUANTUM_ENGINE_PROJECT: The name of a google cloud project, with the quantum engine enabled, that you have access to. QUANTUM_ENGINE_API_KEY: An API key for the google cloud project named by QUANTUM_ENGINE_PROJECT. Raises: EnvironmentError: The environment variables are not set. """

    api_key = os.environ.get(ENV_API_KEY)
    if not api_key:
        raise EnvironmentError(
            'Environment variable {} is not set.'.format(ENV_API_KEY))

    default_project_id = os.environ.get(ENV_DEFAULT_PROJECT_ID)

    return Engine(api_key=api_key, default_project_id=default_project_id)