tools/fix_b2g_stack.py
def first(pred, iter):
    '''Return the first element of iter which matches the predicate pred, or
    return None if no such element exists.

    This function avoids running pred unnecessarily, so is suitable for use
    when pred is expensive.

    '''
    try:
        return itertools.ifilter(pred, iter).next()
    except StopIteration:
        return None
Return the first element of iter which matches the predicate pred, or
    return None if no such element exists.

    This function avoids running pred unnecessarily, so is suitable for use
    when pred is expensive.

    
Return the first element of iter which matches the predicate pred, or
return None if no such element exists.

This function avoids running pred unnecessarily, so is suitable for use
when pred is expensive.
Return the first element of iter which matches the predicate pred or return None if no such element exists . This function avoids running pred unnecessarily so is suitable for use when pred is expensive .
def first(pred, iter):
    try:
        return itertools.ifilter(pred, iter).next()
    except StopIteration:
        return None
def first ( pred , iter ) : try : return itertools . ifilter ( pred , iter ) . next ( ) except StopIteration : return None
Return the first element of iter which matches the predicate pred, or
return None if no such element exists.
Return the first element of iter which matches the predicate pred or return None if no such element exists .
'''Return the first element of iter which matches the predicate pred, or
    return None if no such element exists.

    This function avoids running pred unnecessarily, so is suitable for use
    when pred is expensive.

    '''
pred
iter