class_docstr: A weighted mixture of different anchor selection strategies.
docstr: Initialize the selection strategy.
  
  :param selections:
      the individual selections.
      For the sake of selecting unique anchors, selections will be executed in the given order
      eg, ['degree', 'pagerank'] will be executed differently from ['pagerank', 'degree']
  :param ratios:
      the ratios, cf. normalize_ratios. None means uniform ratios
  :param selections_kwargs:
      additional keyword-based arguments for the individual selection strategies
  :param kwargs:
      additional keyword-based arguments passed to AnchorSelection.__init__,
      in particular, the total number of anchors.
code: def __init__(
      self,
      selections: Sequence[HintOrType[AnchorSelection]],
      ratios: Union[None, float, Sequence[float]] = None,
      selections_kwargs: OneOrSequence[OptionalKwargs] = None,
      **kwargs,
  ) -> None:
      """
      Initialize the selection strategy.
  
      :param selections:
          the individual selections.
          For the sake of selecting unique anchors, selections will be executed in the given order
          eg, ['degree', 'pagerank'] will be executed differently from ['pagerank', 'degree']
      :param ratios:
          the ratios, cf. normalize_ratios. None means uniform ratios
      :param selections_kwargs:
          additional keyword-based arguments for the individual selection strategies
      :param kwargs:
          additional keyword-based arguments passed to AnchorSelection.__init__,
          in particular, the total number of anchors.
      """
      super().__init__(**kwargs)
      n_selections = len(selections)
      # input normalization
      if selections_kwargs is None:
          selections_kwargs = [None] * n_selections
      if ratios is None:
          ratios = numpy.ones(shape=(n_selections,)) / n_selections
      # determine absolute number of anchors for each strategy
      num_anchors = get_absolute_split_sizes(
          n_total=self.num_anchors,
          ratios=normalize_ratios(ratios=ratios),
      )
      self.selections = [
          anchor_selection_resolver.make(
              selection, selection_kwargs, num_anchors=num
          )
          for selection, selection_kwargs, num in zip(
              selections, selections_kwargs, num_anchors
          )
      ]
      # if pre-instantiated
      for selection, num in zip(self.selections, num_anchors):
          if selection.num_anchors != num:
              logger.warning(
                  f"{selection} had wrong number of anchors. Setting to {num}"
              )
              selection.num_anchors = num
  
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 1 to create a new MixtureAnchorSelection object from inherited base classes: AnchorSelection with example: obj = MixtureAnchorSelection(selections, ratios, selections_kwargs)