from contextlib import suppress


def flatten(lst):
    """
    Flatten list.

    :param lst: A list to be flattened
    :type lst: ``list``
    :return: Flattened list
    :rtype: ``list``
    """
    flattened = []
    for element in lst:
        if isinstance(element, str):
            flattened.append(element)
        else:
            with suppress(TypeError):
                flattened.extend(element)
    return flattened