<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(ctx, param, value):
 """Return default endpoint if specified."""

    if ctx.resilient_parsing:
        return

    config = ctx.obj['config']
    endpoint = default_endpoint_from_config(config, option=value)

    if endpoint is None:
        raise click.UsageError('No default endpoint found.')

    return endpoint