def _fix_searchGroups(self, force=False):
        """resolve list of groups to search for symbol names:

        The variable self._sys.searchGroups holds the list of group
        names for searching for symbol names.  A user can set this
        dynamically.  The names need to be absolute (that is, relative to
        _main, and can omit the _main prefix).

        This calclutes and returns self._sys.searchGroupObjects,
        which is the list of actual group objects (not names) resolved from
        the list of names in _sys.searchGroups)

        _sys.localGroup,_sys.moduleGroup come first in the search list,
        followed by any search path associated with that module (from
        imports for that module)
        """
        ##
        # check (and cache) whether searchGroups needs to be changed.
        sys = self._sys
        cache = sys.__cache__
        if len(cache) < 5:
            cache = [None]*5
        if (sys.paramGroup   == cache[0] and
            sys.localGroup   == cache[1] and
            sys.moduleGroup  == cache[2] and
            sys.searchGroups == cache[3] and
            cache[4] is not None and not force):
            return cache[4]

        if sys.moduleGroup is None:
            sys.moduleGroup = self.top_group
        if sys.localGroup is None:
            sys.localGroup = self.moduleGroup
        if not isgroup(sys.paramGroup): sys.paramGroup = None
        cache[0] = sys.paramGroup
        cache[1] = sys.localGroup
        cache[2] = sys.moduleGroup
        snames  = []
        sgroups = []
        for grp in (sys.localGroup, sys.paramGroup, sys.moduleGroup):
            if grp is not None and grp not in sgroups:
                sgroups.append(grp)
                snames.append(grp.__name__)

        sysmods = list(self._sys.modules.values())
        searchGroups  = sys.searchGroups[:]
        searchGroups.extend(self._sys.core_groups)
        for name in searchGroups:
            grp = None
            if self._sys.modules in name:
                grp = self._sys.modules[name]
            elif hasattr(self, name):
                gtest = getattr(self, name)
                if isinstance(gtest, Group):
                    grp = gtest
            elif '.' in name:
                parent, child= name.split('.')
                for sgrp in sysmods:
                    if (parent == sgrp.__name__ and
                        hasattr(sgrp, child)):
                        grp = getattr(sgrp, child)
                        break
            else:
                for sgrp in sysmods:
                    if hasattr(sgrp, name):
                        grp = getattr(sgrp, name)
                        break
            if grp is not None and grp not in sgroups:
                sgroups.append(grp)
                snames.append(name)

        self._sys.searchGroups = cache[3] = snames[:]
        sys.searchGroupObjects = cache[4] = sgroups[:]
        return sys.searchGroupObjects
dataset/ETHPy150Open xraypy/xraylarch/lib/symboltable.py/SymbolTable._fix_searchGroups/swapped operands of `in`