def METHOD_NAME(self, api="v2"):
    """Return default headers for CPI requests.
    Tries to build an 'Authorization' header with local credentials
    if they are available.
    Also pin specific branded store if `SNAPCRAFT_UBUNTU_STORE`
    environment is set.
    """
    headers = {}
    brand_store = os.getenv("SNAPCRAFT_UBUNTU_STORE")
    if brand_store:
        if api == "v2":
            headers["Snap-Device-Store"] = brand_store
        elif api == "v1":
            headers["X-Ubuntu-Store"] = brand_store
        else:
            logger.warning("Incorrect API version passed: {!r}.".format(api))
    return headers