def find_free_ports(start_port, end_port, count, address='localhost'):
 ports = []
 i = start_port
 while ((i < end_port) and (count > 0)):
  if is_port_free(i, address):
   ports.append(i)
   count -= 1
  i += 1
 return ports

def find_free_ports ( start_port , end_port , count , address = 'localhost' ) : ports = [ ] i = start_port while ( ( i < end_port ) and ( count > 0 ) ) : if is_port_free ( i , address ) : ports . append ( i ) count -= 1 i += 1 return ports
return count of host free ports in the range [start_port .