def parse_hausdorff(ml_log, log=None, print_output=False):
hausdorff_distance = {"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0>}<EOL>with open(ml_log) as fread:<EOL><INDENT>result = fread.readlines()<EOL>data = "<STR_LIT>"<EOL>for idx, line in enumerate(result):<EOL><INDENT>m = re.match(r"<STR_LIT>", line)<EOL>if m is not None:<EOL><INDENT>hausdorff_distance["<STR_LIT>"] = int(m.group(<NUM_LIT:1>))<EOL><DEDENT>if '<STR_LIT>' in line:<EOL><INDENT>data = result[idx + <NUM_LIT:2>]<EOL><DEDENT><DEDENT>m = re.match(r"<STR_LIT>", data)<EOL>hausdorff_distance["<STR_LIT>"] = float(m.group(<NUM_LIT:1>))<EOL>hausdorff_distance["<STR_LIT>"] = float(m.group(<NUM_LIT:2>))<EOL>hausdorff_distance["<STR_LIT>"] = float(m.group(<NUM_LIT:3>))<EOL>hausdorff_distance["<STR_LIT>"] = float(m.group(<NUM_LIT:4>))<EOL>for key, value in hausdorff_distance.items():<EOL><INDENT>if log is not None:<EOL><INDENT>log_file = open(log, '<STR_LIT:a>')<EOL>log_file.write('<STR_LIT>'.format(key, value))<EOL>log_file.close()<EOL><DEDENT>elif print_output:<EOL><INDENT>print('<STR_LIT>'.format(key, value))<EOL><DEDENT><DEDENT>return hausdorff_distance<EOL><DEDENT>
Parse the ml_log file generated by the hausdorff_distance function.

    Args:
        ml_log (str): MeshLab log file to parse
        log (str): filename to log output

    Returns:
        dict: dictionary with the following keys:
            number_points (int): number of points in mesh
            min_distance (float): minimum hausdorff distance
            max_distance (float): maximum hausdorff distance
            mean_distance (float): mean hausdorff distance
            rms_distance (float): root mean square distance