from typing import Any


def get_value_from_ndpi_comments(
    comments: str,
    value_name: str,
    value_type: Any
) -> Any:
    """Read value from ndpi comment string."""
    for line in comments.split("\n"):
        if value_name in line:
            value_string = line.split('=')[1]
            return(value_type(value_string))