human
I wrote the below code

    algorithm_funcs = {'parallel': _ica_par, 'deflation': _ica_def}
    alpha = fun_args.get('alpha', 1.0)
    if ((alpha < 1) or (alpha > 2)):
        raise ValueError('alpha    must    be    in    [1,2]')
    if (type(fun) is types.StringType):
        if (fun == 'logcosh'):
            def g(x, fun_args):
                alpha = fun_args.get('alpha', 1.0)
                return np.tanh((alpha * x))
            def gprime(x, fun_args):
                alpha = fun_args.get('alpha', 1.0)
                return (alpha * (1 - (np.tanh((alpha * x)) ** 2)))
        elif (fun == 'exp'):
            def g(x, fun_args):
                return (x * np.exp(((- (x ** 2)) / 2)))
            def gprime(x, fun_args):
                return ((1 - (x ** 2)) * np.exp(((- (x ** 2)) / 2)))
        elif (fun == 'cube'):
            def g(x, fun_args):
                return (x ** 3)
            def gprime(x, fun_args):
                return (3 * (x ** 2))
        else:
            raise ValueError('fun    argument    should    be    one    of    logcosh,    exp    or    cube')
    elif (type(fun) is not types.FunctionType):
        raise ValueError('fun    argument    should    be    either    a    string    (one    of    logcosh,    exp    or    cube)    or    a    function')
    else:
        def g(x, fun_args):
            return fun(x, **fun_args)
        def gprime(x, fun_args):
            return fun_prime(x, **fun_args)
    (n, p) = X.shape
    if (n_comp is None):
        n_comp = min(n, p)
    if (n_comp > min(n, p)):
        n_comp = min(n, p)
        print ('n_comp    is    too    large:    it    will    be    set    to    %s' % n_comp)
    if whiten:
        X = (X - X.mean(axis=0))
        (_, d, v) = np.linalg.svd(X, full_matrices=False)
        del _
        K = (v * (np.sqrt(n) / d)[:, np.newaxis])[:n_comp]
        del v, d
        X1 = np.dot(K, X.T)
    else:
        X1 = X.T
    if (w_init is None):
        w_init = np.random.normal(size=(n_comp, n_comp))
    else:
        w_init = np.asarray(w_init)
       ...

What's a good function header?

=====
Can you provide a Python code to print ('n_comp    is    too    large:    it    will    be    set    to    %s' % n_comp)?
assistant
#Here is Python code to print ('n_comp    is    too    large:    it    will    be    set    to    %s' % n_comp)
.

def fastica(X, n_comp=None, algorithm='parallel', whiten=True, fun='logcosh', fun_prime='', fun_args={}, maxit=200, tol=0.0001, w_init=None):