text: # -----------------------------------------------------------------------------
  # From Numpy to Python
  # Copyright (2017) Nicolas P. Rougier - BSD license
  # More information at https://github.com/rougier/numpy-book
  # -----------------------------------------------------------------------------
  
  import numpy as np
  import numba as nb
  
  
  @nb.jit(nopython=False, forceobj=True, parallel=True, fastmath=True)
  def mandelbrot(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
      # Adapted from https://www.ibm.com/developerworks/community/blogs/jfp/...
      #              .../entry/How_To_Compute_Mandelbrodt_Set_Quickly?lang=en
      X = np.linspace(xmin, xmax, xn, dtype=np.float64)
      Y = np.linspace(ymin, ymax, yn, dtype=np.float64)
      C = X + Y[:, None] * 1j
      N = np.zeros(C.shape, dtype=np.int64)
      Z = np.zeros(C.shape, dtype=np.complex128)
      for n in range(maxiter):
          I = np.less(abs(Z), horizon)
          N[I] = n
          Z[I] = Z[I]**2 + C[I]
      N[N == maxiter - 1] = 0
      return Z, N
  