code: def remap_clusterings(
      clusterings: ty.Sequence[ty.Sequence[ty.Set[ty.Hashable]]],
  ) -> RemapClusteringsReturn:
      """Remap clusterings of arbitrary elements to clusterings of integers."""
      elts = set(
          e for clusters in clusterings for c in clusters for e in c
      )
      elts_map = {e: i for i, e in enumerate(elts)}
      res = []
      for clusters in clusterings:
          remapped_clusters = []
          for c in clusters:
              remapped_c = [elts_map[e] for e in c]
              remapped_clusters.append(remapped_c)
          res.append(remapped_clusters)
      return RemapClusteringsReturn(res, elts_map)
  
file_path: DeepKE/src/deepke/triple_extraction/ASP/metrics/blanc.py
imports: import math
  import typing
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: remap_clusterings(clusterings) and returns: RemapClusteringsReturn