# Path: aerofiles/openair/patterns.py
# _INT = r'\d+'
# _FLOAT = r'%s(?:\.%s)?' % (_INT, _INT)
# _C1 = r'(%s):(%s):(%s)' % (_INT, _INT, _FLOAT)
# _C2 = r'(%s):(%s)' % (_INT, _FLOAT)
# _L = r'%s\s*([NS])\s*%s\s*([EW])'
# _L1 = _L % (_C1, _C1)
# _L2 = _L % (_C2, _C2)
# LOCATION_FORMAT_1 = re.compile(_L1)
# LOCATION_FORMAT_2 = re.compile(_L2)


from aerofiles.openair import patterns
    values = value.split(separator)
    if len(values) != num:
        raise ValueError()

    return [cast(v.strip()) for v, cast in zip(values, types)]


def coordinate(value):
    # 39:35:00 N 118:59:20 W
    match = patterns.LOCATION_FORMAT_1.match(value)
    if match:
        lat = \
            int(match.group(1)) + \
            int(match.group(2)) / 60. + \
            float(match.group(3)) / 3600.

        if match.group(4) == 'S':
            lat = -lat

        lon = \
            int(match.group(5)) + \
            int(match.group(6)) / 60. + \
            float(match.group(7)) / 3600.

        if match.group(8) == 'W':
            lon = -lon

        return [lat, lon]

    # 39:29.9 N 119:46.1 W

# Path: aerofiles/openair/patterns.py
# _INT = r'\d+'
# _FLOAT = r'%s(?:\.%s)?' % (_INT, _INT)
# _C1 = r'(%s):(%s):(%s)' % (_INT, _INT, _FLOAT)
# _C2 = r'(%s):(%s)' % (_INT, _FLOAT)
# _L = r'%s\s*([NS])\s*%s\s*([EW])'
# _L1 = _L % (_C1, _C1)
# _L2 = _L % (_C2, _C2)
# LOCATION_FORMAT_1 = re.compile(_L1)
# LOCATION_FORMAT_2 = re.compile(_L2)


# Path: aerofiles/openair/reader.py
from aerofiles.openair import patterns

    values = value.split(separator)
    if len(values) != num:
        raise ValueError()

    return [cast(v.strip()) for v, cast in zip(values, types)]


def coordinate(value):
    # 39:35:00 N 118:59:20 W
    match = patterns.LOCATION_FORMAT_1.match(value)
    if match:
        lat = \
            int(match.group(1)) + \
            int(match.group(2)) / 60. + \
            float(match.group(3)) / 3600.

        if match.group(4) == 'S':
            lat = -lat

        lon = \
            int(match.group(5)) + \
            int(match.group(6)) / 60. + \
            float(match.group(7)) / 3600.

        if match.group(8) == 'W':
            lon = -lon

        return [lat, lon]

    # 39:29.9 N 119:46.1 W

    match = patterns.LOCATION_FORMAT_2.match(value)