code: def compute_2bit(arr, curr_residual, threshold):
      str_quant = ""
      new_residual = []
      decompr = []
  
      for idx, val in np.ndenumerate(arr):
          val += curr_residual[idx]
          if val >= threshold:
              str_quant += "11"
              new_residual.append(val - threshold)
              decompr.append(threshold)
          elif val <= -threshold:
              str_quant += "10"
              new_residual.append(val + threshold)
              decompr.append(-threshold)
          else:
              str_quant += "00"
              new_residual.append(val)
              decompr.append(0)
  
      # append extra bits when size of array not a factor of 16
      if len(str_quant) % 16 != 0:
          str_quant += "0" * (16 - len(str_quant) % 16)
      return str_quant, new_residual, decompr
  
file_path: mxnet/tests/nightly/test_kvstore.py
imports: import sys
  import mxnet
  import numpy
  import numpy.random
  import copy
  from mxnet.test_utils import assert_almost_equal
label_desc: Use image node_id 3 for calling a global function with example usage: compute_2bit(arr, curr_residual, threshold) and returns: str_quant,  new_residual,  decompr