code: def _check_endpoint_name(name, logger=logging.getLogger(__name__)):
      """Checks that the endpoint name is valid by comparing it with an RE and
      checking that it is not reserved."""
      if not isinstance(name, str):
          msg = "Endpoint name must be a string"
          logger.log(logging.CRITICAL, msg)
          raise TypeError(msg)
  
      if name == "":
          msg = "Endpoint name cannot be empty"
          logger.log(logging.CRITICAL, msg)
          raise ValueError(msg)
  
      if not _name_checker.match(name):
          msg = (
              "Endpoint name can only contain: a-z, A-Z, 0-9,"
              " underscore, hyphens and spaces."
          )
          logger.log(logging.CRITICAL, msg)
          raise ValueError(msg)
  
imports: import logging
  import os
  import shutil
  from re import compile
label_desc: Use image node_id 1 for calling a global function with example usage: _check_endpoint_name(name, logger) without return types