import re


def get_lines_with(input_list, substr) -> list:
    """
        Get all lines containing a substring.
        Args:
            input_list [str]: List of string to get lines from.
            substr (str): Substring to look for in lines.
        Returns:
            lines [str]: List of lines containing substr.

        -----------
        Function selftests:
        >>> len(get_lines_with(tty2list('./samples/RAID.Slot.1-1.log'), '11/15/19'))
        746
        >>> type(get_lines_with(tty2list('./samples/RAID.Slot.1-1.log'), '11/15/19'))
        <class 'list'>
    """
    # print (input_list)
    lines = []
    for line in input_list:
        # print ('testing line: ', line)
        if re.search(substr, line, re.IGNORECASE):
            lines.append(line)
            # print ('Line added. size of result: ', len(lines))
    return lines