def __init__(self, line_iterator, api_key, ports=None, base_uri=None, ip_query_batch_size=None):
self.line_iterator = line_iterator<EOL>self.api_key = api_key<EOL>self.features = {'<STR_LIT>': [], '<STR_LIT>': []}<EOL>if ports:<EOL><INDENT>for port in ports:<EOL><INDENT>item = {}<EOL>item['<STR_LIT:port>'], item['<STR_LIT>'] = port.split('<STR_LIT::>', <NUM_LIT:2>)<EOL>item['<STR_LIT:port>'] = int(item['<STR_LIT:port>'])<EOL>self.features['<STR_LIT>'].append(item)<EOL><DEDENT>self.ports = list(self.features['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>self.ports = None<EOL><DEDENT>self.base_uri = base_uri or self.default_base_uri<EOL>self.ip_query_batch_size = ip_query_batch_size or self.default_ip_query_batch_size<EOL>if self.ip_query_batch_size > <NUM_LIT:1000>:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if self.base_uri.endswith('<STR_LIT:/>'):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>self.parsed_lines = []<EOL>self.filter = {'<STR_LIT>': [], '<STR_LIT>': []}<EOL>self.unhandled_logs = []<EOL>self.noisy_logs = []<EOL>self.quiet_logs = []<EOL>
:param line_iterator: Any iterator that emits log line strings
:param api_key: The ThreshingFloor API key used for authentication
:param ports: List of port/protocol strings to look for
:param base_uri: The ThreshingFloor API base URI. Defaults to public ThreshingFloor API.
:param ip_query_batch_size: How many IPs to query at a time. Defaults to default_ip_query_batch_size. Cannot
       be more than 1000.