code: def func_name_base_str(
      g: Union[NativeFunctionsGroup, NativeFunctionsViewGroup]
  ) -> str:
      if isinstance(g, NativeFunctionsGroup):
          return str(g.functional.func.name.name.base)
      else:
          return str(g.view.root_name)
  
imports: from typing import Dict, Union
  from torchgen.model import NativeFunctionsGroup, NativeFunctionsViewGroup
label_desc: Use image node_id 1 for calling a global function with example usage: func_name_base_str(g) and returns: str, str