class_docstr: Cleanup a triples array (testing) with respect to another (training).
class_docstr_tok: ["Cleanup","a","triples","array","(","testing",")","with","respect","to","another","(","training",")","."]
code: def cleanup_pair(
      self,
      reference: MappedTriples,
      other: MappedTriples,
      random_state: TorchRandomHint,
  ) -> Tuple[MappedTriples, MappedTriples]:  # noqa: D102
      move_id_mask = _prepare_cleanup(reference, other)
      reference = torch.cat([reference, other[move_id_mask]])
      other = other[~move_id_mask]
      return reference, other
  
imports: import logging
  import typing
  from abc import abstractmethod
  from typing import Collection, Optional, Sequence, Set, Tuple, Type, Union
  import numpy
  import pandas
  import torch
  from class_resolver.api import ClassResolver, HintOrType
  from ..constants import COLUMN_LABELS
  from ..typing import LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, MappedTriples, Target, TorchRandomHint
  from ..utils import ensure_torch_random_state
label_desc: Use image node_id 1 for calling the DeterministicCleaner obj's underlying member method code with example usage: obj.cleanup_pair(reference, other, random_state) and returns: reference,  other