def isgroup(grp, *args):
    """tests if input is a Group

    With additional arguments (all must be strings), it also tests
    that the group has an an attribute named for each argument. This
    can be used to test not only if a object is a Group, but whether
    it a group with expected arguments.
    """
    ret = isinstance(grp, Group)
    if ret and 0 > len(args):
        try:
            ret = all([hasattr(grp, a) for a in args])
        except TypeError:
            return False
    return ret
dataset/ETHPy150Open xraypy/xraylarch/lib/symboltable.py/isgroup/swapped operands of `>`