code: def chose_blacklist(self, ip):
          
          blacklist = 'ellis_blacklist{0}'
  
          try:
              address = ipaddress.ip_address(ip)
          except ipaddress.AddressValueError:
              raise
          else:
              if address.version is 6:
                  # We don't ban private IPv6:
                  if address.is_private:
                      msg = "We don't ban private addresses ({0} given)." \
                            .format(address)
                      raise ipaddress.AddressValueError(msg)
                  else:
                      # Do we have an embedded IPv4 ?
                      if address.ipv4_mapped is not None:
                          address = address.ipv4_mapped
                      elif address.sixtofour is not None:
                          address = address.sixtofour
  
          blacklist = blacklist.format(address.version)
  
          return (address, blacklist)
docs: Given an IP address, figure out the set we have to use.
  
          If the address is an IPv4, we have to use *ellis_blacklist4*.
          If the address is an IPv6, we have to use *ellis_blacklist6*.
  
          Raises ipaddress.AddressValueError if the address is neither
          an IPv4 nor an IPv6.