code: def _check_hostname(name):
      _check_endpoint_type(name)
      hostname_checker = compile(
          r"^^http(s)?://[\w.-]+(/)?(:\d+)?(/)?$"
      )
  
      if not hostname_checker.match(name):
          raise ValueError(
              f"endpoint name {name} should be in http(s)://<hostname>"
              "[:<port>] and hostname may consist only of: "
              "a-z, A-Z, 0-9, underscore and hyphens."
          )
  
imports: import copy
  from re import compile
  import time
  import requests
  from .rest import RequestsNetworkWrapper, ServiceClient
  from .rest_client import RESTServiceClient, Endpoint
  from .custom_query_object import CustomQueryObject
  import os
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: _check_hostname(name) without return types