def default():
    """Retrieves a default Context object, creating it if necessary.

      The default Context is a global shared instance used every time the default context is
      retrieved.

      Attempting to use a Context with no project_id will raise an exception, so on first use
      set_project_id must be called.

    Returns:
      An initialized and shared instance of a Context object.
    """
    credentials = _utils.get_credentials()
    if Context._global_context is None:
      project = _project.Projects.get_default_id(credentials)
      Context._global_context = Context(project, credentials)
    else:
      # Always update the credentials in case the access token is revoked or expired
      Context._global_context.set_credentials(credentials)
    return Context._global_context
Retrieves a default Context object, creating it if necessary.

      The default Context is a global shared instance used every time the default context is
      retrieved.

      Attempting to use a Context with no project_id will raise an exception, so on first use
      set_project_id must be called.

    Returns:
      An initialized and shared instance of a Context object.