<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(cls, filename, max_life=None):
 """ Parse barcode from gudhi output. """

        data = np.genfromtxt(filename)
        #data = np.genfromtxt(filename, dtype= (int, int, float, float))

        if max_life is not None:
            data[np.isinf(data)] = max_life

        return data