def get_first_from_sequence(sequence, default=None):
    """
    Given a sequence, return the first item in the sequence. If the sequence is
    empty, return the passed in default.
    """
    first_result = default
    try:
        first_result = next(sequence)
    except StopIteration:
        pass
    return first_result
