def parse_type_inner(text, start_tok='[', end_tok=']'):
    """
    Returns the inner type of a generic type.
    Example: List[any] => any
    :param text: type text to parse
    :param start_tok: type opening token
    :param end_tok: type end token
    :return: Inner type
    """
    level = 0
    start = None
    for i, c in enumerate(text):
        if c == start_tok:
            if level == 0:
                start = i + 1
            level = level + 1
        elif c == end_tok:
            assert level > 0, 'No start ['
            level = level - 1
            if level == 0:
                return text[start:i]
    assert 0, 'No ] found'