<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def first(seq, key=lambda x: bool(x), default=None, apply=lambda x: x):
 """Give the first value that satisfies the key test. Args: seq (iterable):
 key (callable):
 test for each element of iterable default: returned when all elements fail test apply (callable):
 applied to element before return, but not to default value Returns: first element in seq that passes key, mutated with optional apply Examples: 42 True 'ohai' 'bc' The optional `key` argument specifies a one-argument predicate function like that used for `filter()`. The `key` argument, if supplied, must be in keyword form. For example: 4 """

    return next((apply(x) for x in seq if key(x)), default() if callable(default) else default)