code: def safe_int_conv(number):
      
      try:
          return int(np.array(number).astype(int, casting='safe'))
      except TypeError:
          raise ValueError('cannot safely convert {} to integer'.format(number))
docs: Safely convert a single number to integer.