import re


def natural_sort(l):
    """
    Takes in a list of strings and returns the list sorted in "natural" order. 
    (e.g. [test1, test10, test11, test2, test20] -> [test1, test2, test10, test11, test20])
    Source: https://stackoverflow.com/questions/4836710/is-there-a-built-in-function-for-string-natural-sort
    
    Parameters
    ----------
    l : list of str
        Unsorted list of strings
        
    Returns
    -------
    sorted_l : list of str
        Sorted list of strings
   
    """    
    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(l, key = alphanum_key)