def METHOD_NAME(
    cfg, virtualname, __salt__, _options, profile_attr, profile_attrs
):
    """
    Fetches profile specific options if applicable
    @see :func:`get_returner_options`
    :return: a options dict
    """
    if (not profile_attr) or (profile_attr not in _options):
        return {}
    # Using a profile and it is in _options
    creds = {}
    profile = _options[profile_attr]
    if profile:
        log.debug("Using profile %s", profile)
        if "config.option" in __salt__:
            creds = cfg(profile)
        else:
            creds = cfg.get(profile)
    if not creds:
        return {}
    return {
        pattr: creds.get("{}.{}".format(virtualname, profile_attrs[pattr]))
        for pattr in profile_attrs
    }