import re


def _natural_sort(list_):
    """Sorts a list by natural order.

    Args:
        list_ (:obj:`list`): Complete or relative path to the folder
        you want to explore.

    Returns:
        :obj:`list`:

    Raises:
        AssertError: Raised when the types of the arguments are not respected.

    Examples:
        To sort a simple list of strings :
        >>> list_ = [str(i) for i in range(20)]
        >>> expected_out =  ['0', '1', '2', '3', '4', '5', '6', '7', '8',
        ... '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19']
        >>> out = _natural_sort(list_)
        >>> out == expected_out
        True
        >>> out == sorted(list_)
        False

    """
    convert = lambda text: int(text) if text.isdigit() else text.lower()
    alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
    return sorted(list_, key=alphanum_key)