def _is_prefix(lhs, rhs):
    ' return True if the first list is a prefix of the second '
    rhs = list(rhs)
    while rhs:
        if (lhs == rhs):
            return True
        rhs.pop()
    return False
return True if the first list is a prefix of the second
def _is_prefix(lhs, rhs):
    '  '
    rhs = list(rhs)
    while rhs:
        if (lhs == rhs):
            return True
        rhs.pop()
    return False