def _print_funct(funct, args, kw):
    arglst = []
    if args:
        for arg in args:
            if isinstance(arg, basestring):
                arglst.append("'%s'" % arg)
            else:
                arglst.append("%s" % arg)
    argstr = ', '.join(arglst)
    kwlst = []
    if kw:
        for k, v in kw.items():
            if isinstance(v, basestring):
                kwlst.append("%s='%s'" % (k, v))
            else:
                kwlst.append("%s=%s" % (k, v))
    kwstr = ', '.join(kwlst)
    if kwstr and len(argstr)>0:
        kwstr = ', ' + kwstr
    return "%s(%s%s)" % (funct.__name__, argstr, kwstr)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/doctools.py/_print_funct/original