code: def _validate_linear_constraints_indices_input(
      indices: Tensor, q: int, d: int
  ) -> None:
      if indices.dim() > 2:
          raise UnsupportedError(
              "Linear constraints supported only on individual candidates and "
              "across q-batches, not across general batch shapes."
          )
      elif indices.dim() == 2:
          if indices[:, 0].max() > q - 1:
              raise RuntimeError(f"Index out of bounds for {q}-batch")
          if indices[:, 1].max() > d - 1:
              raise RuntimeError(
                  f"Index out of bounds for {d}-dim parameter tensor"
              )
      elif indices.dim() == 1:
          if indices.max() > d - 1:
              raise RuntimeError(
                  f"Index out of bounds for {d}-dim parameter tensor"
              )
      else:
          raise ValueError("`indices` must be at least one-dimensional")
  
imports: from __future__ import annotations
  from functools import partial
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from botorch.exceptions.errors import CandidateGenerationError, UnsupportedError
  from scipy.optimize import Bounds
  from torch import Tensor
label_desc: Use image node_id 7 for calling a global function with example usage: _validate_linear_constraints_indices_input(indices, q, d) without return types