code: def compute_1bit(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 += "1"
              new_residual.append(val - 1)
              decompr.append(1)
          else:
              str_quant += "0"
              new_residual.append(val + 1)
              decompr.append(-1)
  
      # append extra bits when size of array not a factor of 32
      if len(str_quant) != 32:
          str_quant += "0" * (32 - len(str_quant) % 32)
      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 2 for calling a global function with example usage: compute_1bit(arr, curr_residual, threshold) and returns: str_quant,  new_residual,  decompr