docs: def hist_2d_index(x, y, shape):
      """
      Fast 2d histogram of 2D indices with C++ inner loop optimization.
      Is more than 2 orders faster than np.histogram2d().
      The indices are given in x, y coordinates and have to fit into a histogram of the dimensions shape.
      Parameters
      ----------
      x : array like
      y : array like
      shape : tuple
          tuple with x,y dimensions: (x, y)
  
      Returns
      -------
      np.ndarray with given shape
  
      """
      if len(shape) != 2:
          raise InvalidInputError('The shape has to describe a 2-d histogram')
  
      # change memory alignment for c++ library
      x = np.ascontiguousarray(x.astype(np.int32))
      y = np.ascontiguousarray(y.astype(np.int32))
      result = np.zeros(shape=shape, dtype=np.uint32).ravel()  # ravel hist in c-style, 3D --> 1D
      analysis_functions.hist_2d(x, y, shape[0], shape[1], result)
      return np.reshape(result, shape)