code: def hilbert2(x, N=None):
      """
      Compute the '2-D' analytic signal of `x`
  
      Parameters
      ----------
      x : array_like
          2-D signal data.
      N : int or tuple of two ints, optional
          Number of Fourier components. Default is ``x.shape``
  
      Returns
      -------
      xa : ndarray
          Analytic signal of `x` taken along axes (0,1).
  
      References
      ----------
      .. [1] Wikipedia, "Analytic signal",
          https://en.wikipedia.org/wiki/Analytic_signal
  
      """
      x = atleast_2d(x)
      if x.ndim > 2:
          raise ValueError("x must be 2-D.")
      if iscomplexobj(x):
          raise ValueError("x must be real.")
      if N is None:
          N = x.shape
      elif isinstance(N, int):
          if N <= 0:
              raise ValueError("N must be positive.")
          N = (N, N)
      elif len(N) != 2 or np.any(np.asarray(N) <= 0):
          raise ValueError(
              "When given as a tuple, N must hold exactly "
              "two positive integers"
          )
  
      Xf = fftpack.fft2(x, N, axes=(0, 1))
      h1 = zeros(N[0], "d")
      h2 = zeros(N[1], "d")
      for p in range(2):
          h = eval("h%d" % (p + 1))
          N1 = N[p]
          if N1 % 2 == 0:
              h[0] = h[N1 // 2] = 1
              h[1 : N1 // 2] = 2
          else:
              h[0] = 1
              h[1 : (N1 + 1) // 2] = 2
          exec("h%d = h" % (p + 1), globals(), locals())
  
      h = h1[:, newaxis] * h2[newaxis, :]
      k = x.ndim
      while k > 2:
          h = h[:, newaxis]
          k -= 1
      x = fftpack.ifft2(Xf * h, axes=(0, 1))
      return x
  
imports: from __future__ import division, print_function, absolute_import
  import operator
  import threading
  import sys
  import timeit
  from scipy.spatial import cKDTree
  from .None import sigtools, dlti
  from ._upfirdn import upfirdn, _output_len
  from scipy._lib.six import callable
  from scipy._lib._version import NumpyVersion
  from scipy import fftpack, linalg
  from scipy.fftpack.helper import _init_nd_shape_and_axes_sorted
  from numpy import allclose, angle, arange, argsort, array, asarray, atleast_1d, atleast_2d, cast, dot, exp, expand_dims, iscomplexobj, mean, ndarray, newaxis, ones, pi, poly, polyadd, polyder, polydiv, polymul, polysub, polyval, product, r_, ravel, real_if_close, reshape, roots, sort, take, transpose, unique, where, zeros, zeros_like
  import numpy
  import math
  from scipy.special import factorial
  from .windows import get_window
  from ._arraytools import axis_slice, axis_reverse, odd_ext, even_ext, const_ext
  from .filter_design import cheby1, _validate_sos
  from .fir_filter_design import firwin
label_desc: Use image node_id 25 for calling a global function with example usage: hilbert2(x, N) and returns: x