def _check_name_and_port(name, port):
    """
    Check for invalid name and ports
    """
    if type(name) != str:
        raise TypeError('Name of Predictive Service needs to be a string')
    if port < 0 or port > 65535:
        raise ValueError('Port must be within a certain range, 0 to 65535.')
    if port == 9006 or port == 19006:
        raise ValueError(
            'Port 9006 and 19006 are reserved for cache. Please use another port.'
            )
