def set_project_id(self, project_id):
    """ Set the project_id for the context. """
    self._project_id = project_id
    if self == Context._global_context:
      du.save_project_id(self._project_id)