code: def get_observed(
      Xs: Union[List[torch.Tensor], List[np.ndarray]],
      objective_weights: Tensoray,
      outcome_constraints: Optional[Tuple[Tensoray, Tensoray]] = None,
  ) -> Tensoray:
      """Filter points to those that are observed for objective outcomes and outcomes
      that show up in outcome_constraints (if there are any).
  
      Args:
          Xs: A list of m (k_i x d) feature matrices X. Number of rows k_i
              can vary from i=1,...,m.
          objective_weights: The objective is to maximize a weighted sum of
              the columns of f(x). These are the weights.
          outcome_constraints: A tuple of (A, b). For k outcome constraints
              and m outputs at f(x), A is (k x m) and b is (k x 1) such that
              A f(x) <= b.
  
      Returns:
          Points observed for all objective outcomes and outcome constraints.
      """
      objective_weights_np = as_array(objective_weights)
      used_outcomes: Set[int] = set(
          np.where(objective_weights_np != 0)[0]
      )
      if len(used_outcomes) == 0:
          raise ValueError(
              "At least one objective weight must be non-zero"
          )
      if outcome_constraints is not None:
          used_outcomes = used_outcomes.union(
              np.where(as_array(outcome_constraints)[0] != 0)[1]
          )
      outcome_list = list(used_outcomes)
      X_obs_set = {
          tuple(float(x_i) for x_i in x) for x in Xs[outcome_list[0]]
      }
      for _, idx in enumerate(outcome_list, start=1):
          X_obs_set = X_obs_set.intersection(
              {tuple(float(x_i) for x_i in x) for x in Xs[idx]}
          )
      if isinstance(Xs[0], np.ndarray):
          # pyre-fixme[6]: For 2nd param expected `Union[None, Dict[str, Tuple[typing.A...
          return np.array(list(X_obs_set), dtype=Xs[0].dtype)  # (n x d)
      if isinstance(Xs[0], torch.Tensor):
          # pyre-fixme[7]: Expected `Union[np.ndarray, torch.Tensor]` but got implicit
          #  return value of `None`.
          # pyre-fixme[6]: For 3rd param expected `Optional[_C.dtype]` but got
          #  `Union[np.dtype, _C.dtype]`.
          return torch.tensor(
              list(X_obs_set), device=Xs[0].device, dtype=Xs[0].dtype
          )
  
imports: from __future__ import annotations
  import itertools
  import warnings
  from typing import Callable, Dict, List, Optional, Protocol, Set, Tuple, Union
  import numpy
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.exceptions.core import SearchSpaceExhausted, UnsupportedError
  from ax.models.types import TConfig
  from ax.utils.common.typeutils import checked_cast
  from botorch.acquisition.risk_measures import RiskMeasureMCObjective
  from torch import Tensor
label_desc: Use image node_id 10 for calling a global function with example usage: get_observed(Xs, objective_weights, outcome_constraints) and returns: np, torch