<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_edge_weight(f, nodes):
 """Parse TSPLIB EDGE_WEIGHT_SECTION from file f Supports only FULL_MATRIX for now """

    matrix = []

    n = 0

    for line in f:
        line = strip(line)

        regex = re.compile(r'\s+')

        row = regex.split(line)

        matrix.append(row)

        n = n + 1

        if n == nodes:
            break

    if n != nodes:
        raise ParseException('Missing {} nodes definition from section EDGE_WEIGHT_SECTION'.format(nodes - n))

    return matrix