(self, x)
Returns first found index of given value (or list of values)
Returns first found index of given value (or list of values)
Returns first found index of given value ( or list of values )
def first(self, x):
        """Returns first found index of given value (or list of values)"""

        def _find( x):
            try:
                return self.all.index(str(x))
            except ValueError:
                return None

        if is_collection(x):
            for item in x:
                found = _find(item)
                if found is not None:
                    return found
            return None
        else:
            return _find(x)
def first ( self , x ) : def _find ( x ) : try : return self . all . index ( str ( x ) ) except ValueError : return None if is_collection ( x ) : for item in x : found = _find ( item ) if found is not None : return found return None else : return _find ( x )