code: def _parse_netloc_to_hostname(uri_parts):
      """Parse a URI string to get the correct Hostname."""
      hostname = unquote(uri_parts.hostname or "")
      if "/" in hostname:
          hostname = uri_parts.netloc
          if "@" in hostname:
              hostname = hostname.rsplit("@", 1)[1]
          if ":" in hostname:
              hostname = hostname.split(":", 1)[0]
          hostname = unquote(hostname)
      return hostname
  
imports: from __future__ import annotations
  import json
  import logging
  import warnings
  from json import JSONDecodeError
  from typing import Any
  from urllib.parse import parse_qsl, quote, unquote, urlencode, urlsplit
  import re2
  from sqlalchemy import Boolean, Column, Integer, String, Text
  from sqlalchemy.orm import declared_attr, reconstructor, synonym
  from airflow.configuration import ensure_secrets_loaded
  from airflow.exceptions import AirflowException, AirflowNotFoundException, RemovedInAirflow3Warning
  from airflow.models.base import ID_LEN, Base
  from airflow.models.crypto import get_fernet
  from airflow.secrets.cache import SecretCache
  from airflow.utils.helpers import prune_dict
  from airflow.utils.log.logging_mixin import LoggingMixin
  from airflow.utils.log.secrets_masker import mask_secret
  from airflow.utils.module_loading import import_string
label_desc: Use image node_id 3 for calling a global function with example usage: _parse_netloc_to_hostname(uri_parts) and returns: hostname