<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stops_when(iterable, condition):
 # type: (Iterable, Union[Callable, Any]) -> Iterable """Stop yielding items when a condition arise. Args: iterable: the iterable to filter. condition: if the callable returns True once, stop yielding items. If it's not a callable, it will be converted to one as `lambda condition: condition == item`. Example: [0, 1, 2, 3, 4, 5] [0, 1, 2, 3, 4, 5, 6] """

    if not callable(condition):
        cond_value = condition

        def condition(x):
            return x == cond_value
    return itertools.takewhile(lambda x: not condition(x), iterable)