def insert_sort(input_list):
    """Insert sort function."""
    if isinstance(input_list, list):
        for i in range(len(input_list) - 1):
            for j in range(i + 1, 0, -1):
                if input_list[j] < input_list[j - 1]:
                    temp = input_list[j]
                    input_list[j] = input_list[j - 1]
                    input_list[j - 1] = temp
        return input_list
    else:
        raise TypeError('Function only accepts lists')