code: def ipv4_range_type(string):
      
      import re
      ip_format = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
      if not re.match("^{}$".format(ip_format), string):
          if not re.match("^{ip_format}-{ip_format}$".format(ip_format=ip_format), string):
              raise ValueError
      return string
docs: Validates an IPv4 address or address range.