code: def _endpoint_from_view_func(view_func: t.Callable) -> str:
      """Internal helper that returns the default endpoint for a given
      function.  This always is the function name.
      """
      assert (
          view_func is not None
      ), "expected view func if endpoint is not provided."
      return view_func.__name__
  
imports: from __future__ import annotations
  import importlib.util
  import os
  import pathlib
  import sys
  import typing
  from collections import defaultdict
  from functools import update_wrapper
  from jinja2 import FileSystemLoader
  from werkzeug.exceptions import default_exceptions
  from werkzeug.exceptions import HTTPException
  from werkzeug.utils import cached_property
  from ..None import typing
  from ..cli import AppGroup
  from ..helpers import get_root_path
  from ..templating import _default_template_ctx_processor
label_desc: Use image node_id 2 for calling a global function with example usage: _endpoint_from_view_func(view_func) and returns: view_func