code: def from_url(url: str) -> Tuple[str, str, int, str, Union[Any, str]]:
      try:
          # urlparse doesnt handle no protocol properly
          if "://" not in url:
              url = "http://" + url
          parts = urlparse(url)
          host_or_ip_parts = parts.netloc.split(":")
          # netloc is host:port
          port = 80
          if len(host_or_ip_parts) > 1:
              port = int(host_or_ip_parts[1])
          host_or_ip = host_or_ip_parts[0]
          return (
              host_or_ip,
              parts.path,
              port,
              parts.scheme,
              getattr(parts, "query", ""),
          )
      except Exception as e:
          print(f"Failed to convert url: {url} to GridURL. {e}")
          raise e
  
file_path: PySyft/packages/hagrid/hagrid/util.py
imports: import os
  import subprocess
  import sys
  from typing import Any
  from typing import Tuple
  from typing import Union
  from urllib.parse import urlparse
label_desc: Use image node_id 1 for calling a global function with example usage: from_url(url) and returns: host_or_ip,  parts,  port,  parts,  getattr