code: def check_tuple_size(tuples, tuple_size, context):
      """Helper function to check that the number of points in each tuple is
      equal to tuple_size (e.g. 2 for pairs), and raise a `ValueError` otherwise
      """
      if tuple_size is not None and tuples.shape[1] != tuple_size:
          msg_t = (
              "Tuples of {} element(s) expected{}. Got tuples of {} "
              "element(s) instead (shape={}):\ninput={}.\n"
          ).format(
              tuple_size, context, tuples.shape[1], tuples.shape, tuples
          )
          raise ValueError(msg_t)
  
imports: import numpy
  from numpy.linalg import LinAlgError
  from sklearn.datasets import make_spd_matrix
  from sklearn.decomposition import PCA
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_X_y, check_random_state
  from .exceptions import PreprocessorError, NonPSDError
  from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
  from scipy.linalg import pinvh, eigh
  import sys
  import time
  import warnings
label_desc: Use image node_id 9 for calling a global function with example usage: check_tuple_size(tuples, tuple_size, context) without return types