This line is too long (>80 chars). You could also simply return at this point:

    return (format_lower in direct_embed or
            format_lower in loadable_in_iframe)