code: def _get_version_for_class_from_state(state, klass):
          
          # klass may have been renamed, so we have to look this up in the class rename registry.
          names = [_importable_name(klass)]
          # lookup old names, handled by current klass.
          from .util import class_rename_registry
          names.extend(class_rename_registry.old_handled_by(klass))
          for n in names:
              try:
                  return state['class_tree_versions'][n]
              except KeyError:
                  continue
          # if we did not find a suitable version number return infinity.
          if _debug:
              logger.debug('unable to obtain a __serialize_version for class %s', klass)
          return float('inf')
docs: retrieves the version of the current klass from the state mapping from old locations to new ones.