def court_counties(text: str) -> list:
    """
    Return a list of county names from the text of the statute.
    NOTE: This is highly dependent upon the writing style of the
    Texas Government Code, which, to date, is fairly consistent.

    Args:
        text (str): Text of statute to parse.
    Returns:
        (list): List of counties mentioned in the statute
    """
    search = 'Judicial District is composed of '
    start_pos = text.find(search) + len(search)
    end_pos = text.find('.', start_pos+1)
    counties = text[start_pos: end_pos] \
        .replace(', and ', ',') \
        .replace(' and ', ',') \
        .split(',')
    return [x.replace(' and ', '')
            .replace('County', '')
            .replace('Counties', '')
            .replace('county', '')
            .replace('counties', '')
            .strip() for x in counties]