def reorderByPrefs(self, detectors, prefs):
        if prefs is None:
            return []
        elif prefs == []:
            return detectors
        else:
            prefs.insert(0, '')

            def key_name(d):
                return prefs in d.name and prefs.index(d.name) or sys.maxint
            return sorted(detectors, key=key_name)
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/user_agent_parser.py/DetectorsHub.reorderByPrefs/swapped operands of `in`