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

        def _find(x):
            try:
                for arg in self.all:
                    if x in arg:
                        return self.all.index(arg)
            except ValueError:
                return None

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