code: def decode_bcd(values):
      
  
      bin_str_out = ''
      if isinstance(values, integer_types):
          bin_str_out = bin(values)[2:].zfill(16)
          bin_str_out = bin_str_out[::-1]
      else:
          for value in values:
              bin_str = bin(value)[2:].zfill(16)
              bin_str = bin_str[::-1]
              bin_str_out = bin_str + bin_str_out
  
      dec_num = 0
      for i in range(len(bin_str_out) / 4):
          bcd_num = int(bin_str_out[(i * 4):(i + 1) * 4][::-1], 2)
          if bcd_num > 9:
              dec_num = -dec_num
          else:
              dec_num = dec_num + (bcd_num * pow(10, i))
      return dec_num
docs: decode bcd as int to dec