class_docstr: Abstract drawer that uses a remote service via XML-RPC
  to draw something on a remote display.
class_docstr_tok: ["Abstract","drawer","that","uses","a","remote","service","via","XML-RPC","to","draw","something","on","a","remote","display","."]
docstr: Parses the given URL, resolves the hostname to an IP address
  and returns a new URL with the resolved IP address. This speeds
  up things big time on Mac OS X where an IP lookup would be
  performed for every XML-RPC call otherwise.
docstr_tok: ["Parses","the","given","URL",",","resolves","the","hostname","to","an","IP","address","and","returns","a","new","URL","with","the","resolved","IP","address",".","This","speeds","up","things","big","time","on","Mac","OS","X","where","an","IP","lookup","would","be","performed","for","every","XML-RPC","call","otherwise","."]
code: def _resolve_hostname(url):
      """Parses the given URL, resolves the hostname to an IP address
      and returns a new URL with the resolved IP address. This speeds
      up things big time on Mac OS X where an IP lookup would be
      performed for every XML-RPC call otherwise."""
      from urllib.parse import urlparse, urlunparse
      import re
  
      url_parts = urlparse(url)
      hostname = url_parts.netloc
      if re.match("[0-9.:]+$", hostname):
          # the hostname is already an IP address, possibly with a port
          return url
  
      from socket import gethostbyname
  
      if ":" in hostname:
          hostname = hostname[0 : hostname.index(":")]
      hostname = gethostbyname(hostname)
      if url_parts.port is not None:
          hostname = "%s:%d" % (hostname, url_parts.port)
      url_parts = list(url_parts)
      url_parts[1] = hostname
      return urlunparse(url_parts)
  
imports: from abc import ABCMeta, abstractmethod
  from math import atan2, pi
  from .text import TextAlignment
  from .utils import get_bezier_control_points_for_curved_edge, evaluate_cubic_bezier
label_desc: Use image node_id 2 for calling the AbstractXMLRPCDrawer obj's underlying member method code with example usage: obj._resolve_hostname(url) and returns: urlunparse, url