def _getargs(func):
    """Return the names of all static arguments to the given function."""
    import types
    if isinstance(func, types.MethodType):
        func = func.__func__
    co = func.__code__
    return co.co_varnames[:co.co_argcount]
