bolt/factory.py
def wrapped(f):
    """
    Decorator to append routed docstrings
    """
    import inspect

    def extract(func):
        append = ""
        args = inspect.getargspec(func)
        for i, a in enumerate(args.args):
            if i < (len(args) - len(args.defaults)):
                append += str(a) + ", "
            else:
                default = args.defaults[i-len(args.defaults)]
                if hasattr(default, "__name__"):
                    default = default.__name__
                else:
                    default = str(default)
                append += str(a) + "=" + default + ", "
        append = append[:-2] + ")"
        return append

    doc = f.__doc__ + "\n"
    doc += "    local -> array(" + extract(getattr(ConstructLocal, f.__name__)) + "\n"
    doc += "    spark -> array(" + extract(getattr(ConstructSpark, f.__name__)) + "\n"
    f.__doc__ = doc
    return f
def wrapped(f):
    """
    Decorator to append routed docstrings
    """
    import inspect

    def extract(func):
        append = ""
        args = inspect.getargspec(func)
        for i, a in enumerate(args.args):
            if i < (len(args) - len(args.defaults)):
                append += str(a) + ", "
            else:
                default = args.defaults[i-len(args.defaults)]
                if hasattr(default, "__name__"):
                    default = default.__name__
                else:
                    default = str(default)
                append += str(a) + "=" + default + ", "
        append = append[:-2] + ")"
        return append

    doc = f.__doc__ + "\n"
    doc += "    local -> array(" + extract(getattr(ConstructLocal, f.__name__)) + "\n"
    doc += "    spark -> array(" + extract(getattr(ConstructSpark, f.__name__)) + "\n"
    f.__doc__ = doc
    return f
def wrapped ( f ) : import inspect def extract ( func ) : append = "" args = inspect . getargspec ( func ) for i , a in enumerate ( args . args ) : if i < ( len ( args ) - len ( args . defaults ) ) : append += str ( a ) + ", " else : default = args . defaults [ i - len ( args . defaults ) ] if hasattr ( default , "__name__" ) : default = default . __name__ else : default = str ( default ) append += str ( a ) + "=" + default + ", " append = append [ : - 2 ] + ")" return append doc = f . __doc__ + "\n" doc += "    local -> array(" + extract ( getattr ( ConstructLocal , f . __name__ ) ) + "\n" doc += "    spark -> array(" + extract ( getattr ( ConstructSpark , f . __name__ ) ) + "\n" f . __doc__ = doc return f
Decorator to append routed docstrings
Decorator to append routed docstrings