class_docstr: Anchor entity selection strategy.
docstr: Filter out already known anchors, and select from remaining ones afterwards.
  
  .. note ::
      the output size may be smaller, if there are not enough candidates remaining.
  
  :param anchor_ranking: shape: (n,)
      the anchor node IDs sorted by preference, where the first one is the most preferrable.
  :param known_anchors: shape: (m,)
      a collection of already known anchors
  
  :return: shape: (m + num_anchors,)
      the extended anchors, i.e., the known ones and `num_anchors` novel ones.
code: def filter_unique(
      self,
      anchor_ranking: numpy.ndarray,
      known_anchors: Optional[numpy.ndarray],
  ) -> numpy.ndarray:
      """
      Filter out already known anchors, and select from remaining ones afterwards.
  
      .. note ::
          the output size may be smaller, if there are not enough candidates remaining.
  
      :param anchor_ranking: shape: (n,)
          the anchor node IDs sorted by preference, where the first one is the most preferrable.
      :param known_anchors: shape: (m,)
          a collection of already known anchors
  
      :return: shape: (m + num_anchors,)
          the extended anchors, i.e., the known ones and `num_anchors` novel ones.
      """
      if known_anchors is None:
          return anchor_ranking[: self.num_anchors]
  
      # isin() preserves the sorted order
      unique_anchors = anchor_ranking[
          ~numpy.isin(anchor_ranking, known_anchors)
      ]
      unique_anchors = unique_anchors[: self.num_anchors]
      return numpy.concatenate([known_anchors, unique_anchors])
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import Iterable, Optional, Sequence, Union
  import numpy
  import torch
  from class_resolver import ClassResolver, HintOrType, OptionalKwargs
  from torch_ppr import page_rank
  from ...triples.splitting import get_absolute_split_sizes, normalize_ratios
  from ...typing import OneOrSequence
  from ...utils import ExtraReprMixin
label_desc: Use image node_id 4 for calling the AnchorSelection obj's underlying member method code with example usage: obj.filter_unique(anchor_ranking, known_anchors) and returns: numpy, anchor_ranking