code: def check_integer(n, n_name):
      """Raise an error if n is not a > 0 integer.
  
      Parameters
      ----------
      n : unspecified
         Parameter to be tested.
      n_name : string
         Name of the parameter.
      """
      if (
          n is not None
          and not (isinstance(n, int) and n > 0)
          and n != math.inf
      ):
          raise ValueError(
              f"{n_name} is required to be either"
              " None, math.inf or a strictly positive integer,"
              f" got {n}."
          )
  
file_path: geomstats/geomstats/errors.py
imports: import math
  import geomstats.backend
label_desc: Use image node_id 1 for calling a global function with example usage: check_integer(n, n_name) without return types