(arg)
return arg
Validate user provided absolute time
Validate user provided absolute time
Validate user provided absolute time
def absolute_time(arg):
    """Validate user provided absolute time"""
    if not all([t.isdigit() for t in arg.split(':')]):
        raise argparse.ArgumentTypeError("Invalid time format: {}".format(arg))
    # Valid time (e.g. hour must be between 0..23)
    try:
        datetime.time(*map(int, arg.split(':')))
    except ValueError as e:
        raise argparse.ArgumentTypeError("Invalid time format: {}".format(e))
    return arg
def absolute_time ( arg ) : if not all ( [ t . isdigit ( ) for t in arg . split ( ':' ) ] ) : raise argparse . ArgumentTypeError ( "Invalid time format: {}" . format ( arg ) ) # Valid time (e.g. hour must be between 0..23) try : datetime . time ( * map ( int , arg . split ( ':' ) ) ) except ValueError as e : raise argparse . ArgumentTypeError ( "Invalid time format: {}" . format ( e ) ) return arg