code: def _get_shared_rows(Xs: List[Tensor]) -> Tuple[Tensor, List[Tensor]]:
      """Extract shared rows from a list of tensors
  
      Args:
          Xs: A list of m two-dimensional tensors with shapes
              `(n_1 x d), ..., (n_m x d)`. It is not required that
              the `n_i` are the same.
  
      Returns:
          A two-tuple containing (i) a Tensor with the rows that are
          shared between all the Tensors in `Xs`, and (ii) a list of
          index tensors that indicate the location of these rows
          in the respective elements of `Xs`.
      """
      idcs_shared = []
      Xs_sorted = sorted(Xs, key=len)
      X_shared = Xs_sorted[0].clone()
      for X in Xs_sorted[1:]:
          X_shared = X_shared[
              (X_shared == X.unsqueeze(-2)).all(dim=-1).any(dim=-2)
          ]
      # get indices
      for X in Xs:
          same = (X_shared == X.unsqueeze(-2)).all(dim=-1).any(dim=-1)
          idcs_shared.append(
              torch.arange(same.shape[-1], device=X_shared.device)[same]
          )
      return X_shared, idcs_shared
  
imports: import warnings
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, OrderedDict, Tuple, Type
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.exceptions.core import AxError, AxWarning, UnsupportedError
  from ax.models.types import TConfig
  from ax.utils.common.constants import Keys
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast, not_none
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.logei import qLogNoisyExpectedImprovement
  from botorch.acquisition.multi_objective.logei import qLogNoisyExpectedHypervolumeImprovement
  from botorch.fit import fit_fully_bayesian_model_nuts, fit_gpytorch_mll
  from botorch.models.fully_bayesian import SaasFullyBayesianSingleTaskGP
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.models.gp_regression_fidelity import SingleTaskMultiFidelityGP
  from botorch.models.gp_regression_mixed import MixedSingleTaskGP
  from botorch.models.gpytorch import BatchedMultiOutputGPyTorchModel, GPyTorchModel
  from botorch.models.model import Model, ModelList
  from botorch.models.multitask import MultiTaskGP
  from botorch.models.pairwise_gp import PairwiseGP
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.transforms import is_fully_bayesian
  from gpytorch.mlls.marginal_log_likelihood import MarginalLogLikelihood
  from torch import Tensor
label_desc: Use image node_id 6 for calling a global function with example usage: _get_shared_rows(Xs) and returns: X_shared,  idcs_shared