def class_spec(cls, include=None):
    include = include if include is not None else []

    for fn, method in getmembers(cls, predicate=ismethod):
        if fn in include:
            spec = getargspec(method)
            # spec.args[1:] so we don't include 'self'
            params = spec.args[1:]
            d = len(spec.defaults) if spec.defaults is not None else 0
            r = d - len(params)

            yield (fn, {"required": params[:r],
                        "optional": params[r:]})
dataset/ETHPy150Open girder/girder/clients/ansible/girder.py/class_spec/swapped operands of `-`