code: def _validate_linear_constraints_shape_input(
      shapeX: torch.Size,
  ) -> torch.Size:
      """
      Validate `shapeX` input to `_make_linear_constraints`.
  
      Check that it has either 2 or 3 dimensions, and add a scalar batch
      dimension if it is only 2d.
      """
  
      if len(shapeX) not in (2, 3):
          raise UnsupportedError(
              f"`shapeX` must be `(b) x q x d` (at least two-dimensional). It is "
              f"{shapeX}."
          )
      if len(shapeX) == 2:
          shapeX = torch.Size([1, *shapeX])
      return shapeX
  
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 6 for calling a global function with example usage: _validate_linear_constraints_shape_input(shapeX) and returns: shapeX