def get_type(atype, prompt="", default=None, input=raw_input, error=default_error):
    while 1:
        if default is not None:
            text = input("%s [%s]> " % (prompt, default))
            if not text:
                return default
        else:
            text = input("%s> " % (prompt, ))
        try:
            val = ast.literal_eval(text)
        except (SyntaxError, ValueError):
            error("Error in input. Please enter a {} value.".format(atype.__name__))
            continue
        if type(val) is atype:
            return val
        else:
            error("Please enter a {} value.".format(atype.__name__))
Symmetric decorrelation
dataset/ETHPy150Open kdart/pycopia/core/pycopia/cliutils.py/get_type--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/decomposition/fastica_.py/_sym_decorrelation