code: def norm(x_gpu, handle=None):
      """
      Euclidean norm (2-norm) of real vector.
  
      Computes the Euclidean norm of an array.
  
      Parameters
      ----------
      x_gpu : pycuda.gpuarray.GPUArray
          Input array.
      handle : int
          CUBLAS context. If no context is specified, the default handle from
          `skcuda.misc._global_cublas_handle` is used.
  
      Returns
      -------
      nrm : real
          Euclidean norm of `x`.
  
      Examples
      --------
      >>> import pycuda.autoinit
      >>> import pycuda.gpuarray as gpuarray
      >>> import numpy as np
      >>> import skcuda.linalg as linalg
      >>> linalg.init()
      >>> x = np.asarray(np.random.rand(4, 4), np.float32)
      >>> x_gpu = gpuarray.to_gpu(x)
      >>> nrm = linalg.norm(x_gpu)
      >>> np.allclose(nrm, np.linalg.norm(x))
      True
      >>> x_gpu = gpuarray.to_gpu(np.array([3+4j, 12-84j]))
      >>> linalg.norm(x_gpu)
      85.0
  
      """
  
      if handle is None:
          handle = misc._global_cublas_handle
  
      if len(x_gpu.shape) != 1:
          x_gpu = x_gpu.ravel()
  
      # Compute inner product for 1D arrays:
      if x_gpu.dtype == np.complex64:
          cublas_func = cublas.cublasScnrm2
      elif x_gpu.dtype == np.float32:
          cublas_func = cublas.cublasSnrm2
      elif x_gpu.dtype == np.complex128:
          cublas_func = cublas.cublasDznrm2
      elif x_gpu.dtype == np.float64:
          cublas_func = cublas.cublasDnrm2
      else:
          raise ValueError("unsupported input type")
  
      return cublas_func(handle, x_gpu.size, x_gpu.gpudata, 1)
  
imports: from __future__ import absolute_import, division
  from pprint import pprint
  from string import Template
  from pycuda.tools import context_dependent_memoize
  from pycuda.compiler import SourceModule
  from pycuda.reduction import ReductionKernel
  from pycuda import cumath
  import pycuda.gpuarray
  import pycuda.driver
  import pycuda.elementwise
  import pycuda.tools
  import numpy
  from .None import cublas
  from .None import cudart
  from .None import misc
  from .None import cusolver
  import sys
  from .misc import init, shutdown, add_matvec, div_matvec, mult_matvec
  from .None import install_headers
label_desc: Use image node_id 25 for calling a global function with example usage: norm(x_gpu, handle) and returns: cublas_func