def get_args(func):
    args, varargs, keywords, defaults = inspect.getargspec(func)

    defaults = list(reversed(defaults)) if defaults is not None else []
    args = list(reversed(args))

    while len(defaults) != len(args):
        defaults+=(None,)

    return dict(zip(args, defaults))
returns a dictionary of arg_name:default_values for the input function
dataset/ETHPy150Open NervanaSystems/neon/neon/__init__.py/get_args