code: def get_index(binstr, end_index=160):
      
      res = -1
      try:
          res = binstr.index('1') + 1
      except ValueError:
          res = end_index
      return res
docs: Return the position of the first 1 bit
      from the left in the word until end_index
  
      :param binstr:
      :param end_index:
      :return: