code: def SetupAuth(self,
                  project_id=None,
                  project_number=None,
                  service_account_json_file=None):
      
      if service_account_json_file:
        self._credentials = (
            service_account.Credentials.from_service_account_file(
                service_account_json_file, scopes=_CLOUD_PLATFORM_SCOPE))
        if not project_id:
          with open(service_account_json_file) as f:
            project_id = json.load(f).get('project_id')
      else:
        self._credentials, credentials_project_id = google.auth.default(
            scopes=_CLOUD_PLATFORM_SCOPE)
        project_id = project_id or credentials_project_id
  
      if not project_id:
        raise NoProjectIdError(
            'Unable to determine the project id from the API credentials. '
            'Please specify the project id using the --project_id flag.')
  
      self._project_id = project_id
      self._project_number = project_number or project_id
docs: Sets up authentication with Google APIs.
  
      This will use the credentials from service_account_json_file if provided,
      falling back to application default credentials.
      See https://cloud.google.com/docs/authentication/production.
  
      Args:
        project_id: GCP project ID (e.g. myproject). If not provided, will attempt
            to retrieve it from the credentials.
        project_number: GCP project number (e.g. 72386324623). If not provided,
            project_id will be used in its place.
        service_account_json_file: JSON file to use for credentials. If not
            provided, will default to application default credentials.
      Raises:
        NoProjectIdError: If the project id cannot be determined.