def METHOD_NAME(self, token):
    headers = self.config.headers
    if "Authorization" in headers and "$" in headers["Authorization"]:
        headers["Authorization"] = headers["Authorization"].replace("$token", token)
    if (
        self.token
        and token != self.token
        and self.token in headers["Authorization"]
    ):
        headers["Authorization"] = headers["Authorization"].replace(
            self.token, token
        )
    return headers