code: def ip(value):
      """Validate an IP address (both IPv4 and IPv6)"""
      try:
          return ipv4(value)
      except ValueError:
          pass
      try:
          return ipv6(value)
      except ValueError:
          raise ValueError("{0} is not a valid ip".format(value))
  
imports: from __future__ import unicode_literals
  import re
  import socket
  from datetime import datetime, time, timedelta
  from email.utils import parsedate_tz, mktime_tz
  from six.moves.urllib.parse import urlparse
  import aniso8601
  import pytz
label_desc: Use image node_id 3 for calling a global function with example usage: ip(value) and returns: ipv4, ipv6