code: def get_feasible_samples(
      samples: Tensor,
      inequality_constraints: Optional[
          List[Tuple[Tensor, Tensor, float]]
      ] = None,
  ) -> Tuple[Tensor, float]:
      r"""
      Checks which of the samples satisfy all of the inequality constraints.
  
      Args:
          samples: A `sample size x d` size tensor of feature samples,
              where d is a feature dimension.
          inequality constraints: A list of tuples (indices, coefficients, rhs),
              with each tuple encoding an inequality constraint of the form
              `\sum_i (X[indices[i]] * coefficients[i]) >= rhs`.
      Returns:
          2-element tuple containing
  
          - Samples satisfying the linear constraints.
          - Estimated proportion of samples satisfying the linear constraints.
      """
  
      if inequality_constraints is None:
          return samples, 1.0
  
      nsamples = samples.size(0)
  
      feasible = torch.ones(
          nsamples, device=samples.device, dtype=torch.bool
      )
  
      for indices, coefficients, rhs in inequality_constraints:
          lhs = samples.index_select(1, indices) @ coefficients.to(
              dtype=samples.dtype
          )
          feasible &= lhs >= rhs
  
      feasible_samples = samples[feasible]
  
      p_linear = feasible_samples.size(0) / nsamples
  
      return feasible_samples, p_linear
  
file_path: botorch/botorch/utils/feasible_volume.py
imports: from __future__ import annotations
  from typing import Callable, List, Optional, Tuple
  import botorch.models.model
  import torch
  from botorch.logging import _get_logger
  from botorch.utils.sampling import manual_seed
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: get_feasible_samples(samples, inequality_constraints) and returns: feasible_samples,  p_linear, samples,  int