code: def delete(self, name):
      if self.should_fail_with_auth_error() != AuthErrorStates.NONE:
          self.fail_with_auth_error()
          return
  
      self.logger.log(
          logging.DEBUG, f"Processing DELETE for /endpoints/{name}"
      )
  
      try:
          endpoints = self.tabpy_state.get_endpoints(name)
          if len(endpoints) == 0:
              self.error_out(404, f"endpoint {name} does not exist.")
              self.finish()
              return
  
          # update state
          try:
              endpoint_info = self.tabpy_state.delete_endpoint(name)
          except Exception as e:
              self.error_out(
                  400, f"Error when removing endpoint: {e.message}"
              )
              self.finish()
              return
  
          # delete files
          if endpoint_info["type"] != "alias":
              delete_path = get_query_object_path(
                  self.settings["state_file_path"], name, None
              )
              try:
                  yield self._delete_po_future(delete_path)
              except Exception as e:
                  self.error_out(400, f"Error while deleting: {e}")
                  self.finish()
                  return
  
          self.set_status(204)
          self.finish()
  
      except Exception as e:
          err_msg = format_exception(e, "delete endpoint")
          self.error_out(500, err_msg)
          self.finish()
  
      on_state_change(
          self.settings,
          self.tabpy_state,
          self.python_service,
          self.logger,
      )
  
file_path: TabPy/tabpy/tabpy_server/handlers/endpoint_handler.py
imports: import json
  import logging
  import shutil
  from tabpy.tabpy_server.common.util import format_exception
  from tabpy.tabpy_server.handlers import ManagementHandler
  from tabpy.tabpy_server.handlers.base_handler import STAGING_THREAD
  from tabpy.tabpy_server.management.state import get_query_object_path
  from tabpy.tabpy_server.psws.callbacks import on_state_change
  from tabpy.tabpy_server.handlers.util import AuthErrorStates
  from tornado import gen
label_desc: Use image node_id 4 for calling the EndpointHandler obj's underlying member method code with example usage: obj.delete(name) without return types