def parse_ip_port(address):
  """Parse the IP and PORT from address string"""
  if ':' in address:
    # IP6
    deli = ":"
    
    if '.' in address: # there is PORT
      IP = address.split('.')[0]
      PORT = int(address.split('.')[-1])
    else: # there is no PORT
      IP = address
      PORT = ''
  else:
    # IP4
    deli = "."
    arr = address.split(deli)
    if len(arr) == 5:
      IP = deli.join(arr[:-1])
      PORT = int(arr[-1])
    else:
      IP = address
      PORT = ''
  
  return (IP, PORT)