<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _int_from_str(string):
 """ Convert string into integer Raise: TypeError if string is not a valid integer """

    float_num = float(string)
    int_num = int(float_num)
    if float_num == int_num:
        return int_num
    else:
        # Needed to handle pseudos with fractional charge
        int_num = np.rint(float_num)
        logger.warning("Converting float %s to int %s" % (float_num, int_num))
        return int_num