code: def dumps(x, float_bits=DEFAULT_FLOAT_BITS):
      
      with lock:
          if float_bits == 32:
              encode_func[float] = encode_float32
          elif float_bits == 64:
              encode_func[float] = encode_float64
          else:
              raise ValueError('Float bits (%d) is not 32 or 64' % float_bits)
          r = []
          encode_func[type(x)](x, r)
      return b''.join(r)
docs: Dump data structure to str.
  
      Here float_bits is either 32 or 64.