code: def registry_hostname(registry):
      
      if registry.startswith('http:') or registry.startswith('https:'):
          return urlparse(registry).netloc
      else:
          return registry
docs: Strip a reference to a registry to just the hostname:port