(self, groups, mode)
\
        Private method for .find -> return
\
        Private method for .find -> return
\ Private method for . find - > return
def _triage(self, groups, mode):
        """\
        Private method for .find -> return
        """
        automatic = ["auto", "automatic"]
        all = ["all", "list"]
        first = ["first"]
        last = ["last"]  # undocumented
        random = ["random"]  # undocumented

        if not groups:
            if mode in all:
                return []
            return None
        elif mode in automatic:
            if len(groups) == 1:
                return groups[0]
            return groups
        elif mode in all:
            return groups
        elif mode in first:
            return groups[0]
        elif mode in last:
            return groups[-1]
        elif mode in random:
            return sample(groups, k=1)[0]
        else:
            raise ValueError(mode)
def _triage ( self , groups , mode ) : automatic = [ "auto" , "automatic" ] all = [ "all" , "list" ] first = [ "first" ] last = [ "last" ] # undocumented random = [ "random" ] # undocumented if not groups : if mode in all : return [ ] return None elif mode in automatic : if len ( groups ) == 1 : return groups [ 0 ] return groups elif mode in all : return groups elif mode in first : return groups [ 0 ] elif mode in last : return groups [ - 1 ] elif mode in random : return sample ( groups , k = 1 ) [ 0 ] else : raise ValueError ( mode )