code: def __init_keystone_session(self):
          
          api = self._identity_api_version  # for readability
          tried = []
          if api in ['3', None]:
              sess = self.__init_keystone_session_v3(check=(api is None))
              tried.append('v3')
              if sess:
                  return sess
          if api in ['2', None]:
              sess = self.__init_keystone_session_v2(check=(api is None))
              tried.append('v2')
              if sess:
                  return sess
          raise RuntimeError(
              "Cannot establish Keystone session (tried: {0})."
              .format(', '.join(tried)))
docs: Create and return a Keystone session object.