# Path: pyke/qa_helpers.py
# class regexp(object):
# class qmap(object):
#     def __init__(self, regexp, msg=None, prompt=None):
#     def __repr__(self):
#     def __getstate__(self):
#     def __setstate__(self, args):
#     def match(self, str):
#     def __init__(self, test, value):
#     def __repr__(self):
#     def urepr(x):
# def to_int(str):
# def to_float(str):
# def to_number(str):
# def to_tuple(str, conv_fn=None, test=None, separator=','):
#     def conv_element(elem):
# def msg_for(test, type):
# def match_prompt(test, type, format, default=u''):
#     def prompt_body(test, type):
# def match(ans, test):


import sys
import itertools
from pyke import qa_helpers
        enter number? (float) 4.0
    '''
    return get_answer(question, qa_helpers.match_prompt(match, float, u"[%s]",
                                                        u'(float)'),
                      conv_fn=qa_helpers.to_float,
                      test=match,
                      review=review)

def ask_number(question, match=None, review=None):
    r'''
        >>> from StringIO import StringIO
        >>> sys.stdin = StringIO('4\n')
        >>> ask_number(u'enter number?')
        ______________________________________________________________________________
        enter number? (number) 4
    '''
    return get_answer(question, qa_helpers.match_prompt(match, int, u"[%s]",
                                                        u'(number)'),
                      conv_fn=qa_helpers.to_number,
                      test=match,
                      review=review)

def ask_string(question, match=None, review=None):
    r'''
        >>> from StringIO import StringIO
        >>> sys.stdin = StringIO('yes\n')
        >>> ask_string(u'enter string?')
        ______________________________________________________________________________
        enter string? u'yes'
    '''

# Path: pyke/qa_helpers.py
# class regexp(object):
# class qmap(object):
#     def __init__(self, regexp, msg=None, prompt=None):
#     def __repr__(self):
#     def __getstate__(self):
#     def __setstate__(self, args):
#     def match(self, str):
#     def __init__(self, test, value):
#     def __repr__(self):
#     def urepr(x):
# def to_int(str):
# def to_float(str):
# def to_number(str):
# def to_tuple(str, conv_fn=None, test=None, separator=','):
#     def conv_element(elem):
# def msg_for(test, type):
# def match_prompt(test, type, format, default=u''):
#     def prompt_body(test, type):
# def match(ans, test):


# Path: pyke/ask_tty.py
import sys
import itertools
from pyke import qa_helpers

        enter number? (float) 4.0
    '''
    return get_answer(question, qa_helpers.match_prompt(match, float, u"[%s]",
                                                        u'(float)'),
                      conv_fn=qa_helpers.to_float,
                      test=match,
                      review=review)

def ask_number(question, match=None, review=None):
    r'''
        >>> from StringIO import StringIO
        >>> sys.stdin = StringIO('4\n')
        >>> ask_number(u'enter number?')
        ______________________________________________________________________________
        enter number? (number) 4
    '''
    return get_answer(question, qa_helpers.match_prompt(match, int, u"[%s]",
                                                        u'(number)'),
                      conv_fn=qa_helpers.to_number,
                      test=match,
                      review=review)

def ask_string(question, match=None, review=None):
    r'''
        >>> from StringIO import StringIO
        >>> sys.stdin = StringIO('yes\n')
        >>> ask_string(u'enter string?')
        ______________________________________________________________________________
        enter string? u'yes'
    '''

    return get_answer(question, qa_helpers.match_prompt(match, str, u"[%s]",