code: def trace(
      cluster: ty.Set, partition: ty.Iterable[ty.Set]
  ) -> ty.Iterable[ty.Set]:
      r"""
      Return the partition of `#cluster` induced by `#partition`, that is
      ```math
      \{C∩A|A∈P\} ∪ \{\{x\}|x∈C∖∪P\}
      ```
      Where `$C$` is `#cluster` and `$P$` is `#partition`.
  
      This assume that the elements of `#partition` are indeed pairwise disjoint.
      """
      remaining = set(cluster)
      for a in partition:
          common = remaining.intersection(a)
          if common:
              remaining.difference_update(common)
              yield common
      for x in sorted(remaining):
          yield set((x,))
  
file_path: DeepKE/src/deepke/triple_extraction/ASP/metrics/blanc.py
imports: import math
  import typing
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: trace(cluster, partition) without return types