code: def _check_shapes(parameters, names):
      """Check the shapes of a set of parameters.
  
      This function takes in a set of parameters, as well as their names, and
      checks that the shape is correct. It will raise an error if the lengths
      of the parameters without the value of None are not equal.
  
  
      Parameters
      ----------
      parameters: list or tuple
              A set of parameters, which can be None, to check the shape of.
  
      names: list or tuple
              A set of parameter names to refer to if something is wrong.
      """
  
      n = len(parameters)
  
      for i in range(n):
          for j in range(n):
              if parameters[i] is None:
                  continue
  
              if parameters[j] is None:
                  continue
  
              n1, n2 = names[i], names[j]
              if len(parameters[i]) != len(parameters[j]):
                  raise ValueError(
                      "Parameters {} and {} must be the same "
                      "shape.".format(names[i], names[j])
                  )
  
file_path: pomegranate/pomegranate/_utils.py
imports: import numpy
  import torch
  import collections
  from apricot import FacilityLocationSelection
  from apricot import FeatureBasedSelection
label_desc: Use image node_id 6 for calling a global function with example usage: _check_shapes(parameters, names) without return types