<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def default_endpoint_from_config(config, option=None):
 """Return a default endpoint."""

    default_endpoint = config.get('core', {}).get('default')
    project_endpoint = config.get('project',
                                  {}).get('core',
                                          {}).get('default', default_endpoint)
    return Endpoint(
        option or project_endpoint or default_endpoint,
        default=default_endpoint,
        project=project_endpoint,
        option=option
    )