code: def __fp_normalize(prot, b: "TFEPrivateTensor", nonsigned=False):
      r"""
      Given [b], to compute [sgf], and [exp] such that b = sgf / exp
      where sgf \in [0.5, 1)
      """
      k = prot.fixedpoint_config.precision_fractional
      m = k + prot.fixedpoint_config.precision_integral
      n = b.backing_dtype.nbits
      assert b.is_scaled, "Er.. tricky here."
      assert (
          2 * k > m
      ), "We assume 2^{-j} can be represent with 2k-bit precisions for all j in [0, m)"
      with tf.name_scope("fp_normalize"):
          # juhou: sign.is_scaled is False
          if not nonsigned:
              msb = prot.bit_extract(b, m)
              two = np.ones(shape=msb.shape, dtype=int) * 2
              sign = 1 - prot.mul_ab(prot.define_constant(two), msb)
              x = sign * b  # abs(b)
          else:
              sign, x = 1, b
  
          # bit-decomposition. Make sure the higher bits are all 0 via shifting.
          x_bits = (prot.a2b(x, m) << (n - m)) >> (n - m)
          """
             y_j = 1 <-> for all i <= j, y_i = 1.
             z_j = 1 <-> 2^j < x = 2^j + x0 < 2^{j+1}.
             And there is only one z_j = 1, and others are all 0.
          """
          y_bits = prefix_ORs(x_bits, m)
          z = y_bits ^ (y_bits >> 1)
  
          r"""
              There exists one z_j = 1 and other z_i = 0.
              As as result, \sum_i 2^i * z_i = 2^j (i.e., b2a(z))
              If we reverse the bits {z_i} to obtain {z'_i} for z'_i = z_{128 - i}.
              Then \sum_i 2^i * z'_i = 2^{128 - j}.
              Also, if we right shift {z'_i} by (128 - m)-steps.
              Then we obtain 2^{m - j}, which equals to the fixed-point
              representation of 2^{-j} within m-bits precision.
          """
          # NOTE: We couldn't obtain 2^{-j} with only k-bits precision
          # because j > k might be possible (i.e., b = 2^k * b' for
          # real value b' > 1).
          # Instead, we preserve 2k-bit precision, i.e., c = 2^{-j} with 2k bits precision
          _exp = prot.b2a(prot.bit_reverse(z) >> (n - 2 * k), 2 * k)
          _exp.is_scaled = True
          sgf = (
              x * _exp
          )  # significant should in [0.5, 1). Thus, sgf should be positive.
          exp = _exp if nonsigned else sign * _exp
      return sgf, exp
  
imports: from math import ceil
  from math import log2
  import numpy
  import tensorflow
  from ..protocol import TFEPrivateTensor
  from ..protocol import TFEPublicTensor
label_desc: Use image node_id 15 for calling a global function with example usage: __fp_normalize(prot, b, nonsigned) and returns: sgf,  exp