code: def check_x_in_space(x, space):
      """Check that an arbitrary point, or list of points, fits within the bounds of `space`
  
      Parameters
      ----------
      x: List
          Some point (or list of points), whose compatibility with `space` will be checked. If `x` is
          a collection of multiple points, it should be a list of lists
      space: Space
          Instance of :class:`hyperparameter_hunter.space.space_core.Space` that defines the
          dimensions and bounds within which `x` should fit
  
      Raises
      ------
      ValueError
          If `x` is incompatible with `space` for any reason"""
      if is_2d_list_like(x):
          if not np.all([p in space for p in x]):
              raise ValueError(
                  "Not all points are within the bounds of the space"
              )
          if any([len(p) != len(space.dimensions) for p in x]):
              raise ValueError(
                  "Not all points have the same dimensions as the space"
              )
      elif is_list_like(x):
          if x not in space:
              raise ValueError(
                  f"Point {x} is not within the bounds of the space ({space.bounds})"
              )
          if len(x) != len(space.dimensions):
              raise ValueError(
                  f"Dimensions of point {x} and space ({space.bounds}) do not match"
              )
  
imports: from hyperparameter_hunter.settings import G
  from hyperparameter_hunter.space.space_core import Space, normalize_dimensions
  from joblib import Parallel, delayed
  from math import log
  from numbers import Number
  import numpy
  import sys
  import warnings
  from scipy.optimize import fmin_l_bfgs_b
  from sklearn.base import clone, is_regressor
  from sklearn.ensemble import GradientBoostingRegressor
  from sklearn.multioutput import MultiOutputRegressor
  from sklearn.utils import check_random_state
  from skopt.acquisition import _gaussian_acquisition, gaussian_acquisition_1D
  from skopt.learning import ExtraTreesRegressor, GaussianProcessRegressor, GradientBoostingQuantileRegressor, RandomForestRegressor
  from skopt.learning.gaussian_process.kernels import ConstantKernel, HammingKernel, Matern
  from skopt.utils import create_result, has_gradients
label_desc: Use image node_id 3 for calling a global function with example usage: check_x_in_space(x, space) without return types