code: def tucker_normalize(tucker_tensor):
      """Returns tucker_tensor with factors normalised to unit length with the normalizing constants absorbed into
      `core`.
  
      Parameters
      ----------
      tucker_tensor : tl.TuckerTensor or (core, factors)
          core tensor and list of factor matrices
  
      Returns
      -------
      TuckerTensor((core, factors))
      """
      core, factors = tucker_tensor
      normalized_factors = []
      for i, factor in enumerate(factors):
          scales = tl.norm(factor, axis=0)
          scales_non_zero = tl.where(
              scales == 0,
              tl.ones(tl.shape(scales), **tl.context(factor)),
              scales,
          )
          core = core * tl.reshape(
              scales, (1,) * i + (-1,) + (1,) * (tl.ndim(core) - i - 1)
          )
          normalized_factors.append(
              factor / tl.reshape(scales_non_zero, (1, -1))
          )
      return TuckerTensor((core, normalized_factors))
  
imports: from ._factorized_tensor import FactorizedTensor
  from .base import unfold, tensor_to_vec
  from .tenalg import multi_mode_dot, mode_dot
  from .None import backend
  import numpy
  from scipy.optimize import brentq
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: tucker_normalize(tucker_tensor) and returns: TuckerTensor