

def _isgroup(obj, *args, **kws):
    "return whether argument is a group or the name of a group\n\n    With additional arguments (all must be strings), it also tests\n    that the group has an an attribute named for each argument. This\n    can be used to test not only if a object is a Group, but whether\n    it a group with expected arguments.\n\n        > x = 10\n        > g = group(x=x, y=2)\n        > isgroup(g), isgroup(x)\n        True, False\n        > isgroup('g'), isgroup('x')\n        True, False\n        > isgroup(g, 'x', 'y')\n        True\n        > isgroup(g, 'x', 'y', 'z')\n        False\n\n    "
    _larch = kws.get('_larch', None)
    if (_larch is None):
        raise Warning('cannot run isgroup() -- larch broken?')
    stable = _larch.symtable
    if (isinstance(obj, (str, unicode)) and stable.has_symbol(obj)):
        obj = stable.get_symbol(obj)
    return isgroup(obj, *args)

dataset/ETHPy150Open xraypy/xraylarch/lib/builtins.py _isgroup/original