tools/utils.py
def argparse_force_type(case):
    """ validate that an argument passed in (as string) is a member of the list
    of possible arguments after converting it's case.
    """
    def middle(lst, type_name):
        """ The parser type generator"""
        def parse_type(string):
            """ The parser type"""
            for option in lst:
                if case(string) == case(option):
                    return option
            raise argparse.ArgumentTypeError(
                "{0} is not a supported {1}. Supported {1}s are:\n{2}".
                format(string, type_name, columnate(lst)))
        return parse_type
    return middle
 validate that an argument passed in (as string) is a member of the list
    of possible arguments after converting it's case.
    
validate that an argument passed in (as string) is a member of the list
of possible arguments after converting it's case.
validate that an argument passed in ( as string ) is a member of the list of possible arguments after converting it ' s case .
def argparse_force_type(case):
    def middle(lst, type_name):
        def parse_type(string):
            for option in lst:
                if case(string) == case(option):
                    return option
            raise argparse.ArgumentTypeError(
                "{0} is not a supported {1}. Supported {1}s are:\n{2}".
                format(string, type_name, columnate(lst)))
        return parse_type
    return middle
def argparse_force_type ( case ) : def middle ( lst , type_name ) : """ The parser type generator""" def parse_type ( string ) : """ The parser type""" for option in lst : if case ( string ) == case ( option ) : return option raise argparse . ArgumentTypeError ( "{0} is not a supported {1}. Supported {1}s are:\n{2}" . format ( string , type_name , columnate ( lst ) ) ) return parse_type return middle
validate that an argument passed in (as string) is a member of the list
of possible arguments after converting it's case.
validate that an argument passed in ( as string ) is a member of the list of possible arguments after converting it ' s case .
""" validate that an argument passed in (as string) is a member of the list
    of possible arguments after converting it's case.
    """ """ The parser type generator""" """ The parser type"""
case