code: def expand_ip (ip):
      
      if _ipv4_re.match(ip) or \
         _ipv6_re.match(ip) or \
         _ipv6_ipv4_re.match(ip):
          return (ip, 1)
      if _ipv6_abbr_re.match(ip):
          return (expand_ipv6(ip, 8), 1)
      if _ipv6_ipv4_abbr_re.match(ip):
          i = ip.rfind(":") + 1
          return (expand_ipv6(ip[:i], 6) + ip[i:], 1)
      return (ip, 0)
docs: ipv6 addresses are expanded to full 8 octets, all other
      addresses are left untouched
      return a tuple (ip, num) where num==1 if ip is a numeric ip, 0
      otherwise.