def timeparse(x, formats=('%H:%M:%S', '%H:%M:%S.%f')):
    msg = ''
    for format in formats:
        try:
            return datetime.strptime(x, format).time()
        except __HOLE__ as e:  # raises if it doesn't match the format
            msg = str(e)
    raise ValueError(msg)
dataset/ETHPy150Open blaze/datashape/datashape/discovery.py/timeparse