code: def normalizeIndex(value):
      
      if value is not None:
          if not isinstance(value, int):
              raise TypeError("Indexes must be None or integers, not %s."
                              % type(value).__name__)
      return value
docs: Normalizes index.
  
      * **value** must be an ``int`` or ``None``.
      * Returned value is the same type as the input value.