def METHOD_NAME(fin: Iterable[str], nick: str, metrics_names: set=None) -> Tuple[Dict[str, float], Dict[str, int]]:
    """Parse metrics file and return dicts of values and types"""
    out = {}
    types = {}
    try:
        last_type = None
        for line in fin:
            if not line:
                continue
            line = line.strip()
            if not line:
                continue
            if line[0] == '#':
                if line.startswith('# TYPE'):
                    tpe = line.split()[-1]
                    if tpe == 'gauge':
                        last_type = TYPE_GAUGE
                    elif tpe == 'counter':
                        last_type = TYPE_COUNTER
                continue
            m = metric_line_re.match(line)
            if m:
                name = m.group(1)
                value = num(m.group(2))
            else:
                ab = line.split()
                name = ab[0]
                value = num(ab[1])
            det_idx = name.find('{')
            if det_idx != -1:
                name = name[:det_idx]
            fullname = f'{name}{{n={nick}}}'
            if not metrics_names or name in metrics_names:
                out[fullname] = value
                types[fullname] = last_type
    except:
        print(f'An exception occurred in parse_metrics: {sys.exc_info()}')
        pass
    return out, types