<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_index(binstr, end_index=160):
 """ Return the position of the first 1 bit from the left in the word until end_index :param binstr: :param end_index: :return: """

    res = -1
    try:
        res = binstr.index('1') + 1
    except ValueError:
        res = end_index
    return res