code: def _info_commands(widget, pattern=None):
      return widget.tk.splitlist(
          widget.tk.call("info", "commands", pattern)
      )
  
imports: import functools
  import unittest
  import tkinter
  from tkinter import TclError
  import enum
  from test import support
  from test.test_tkinter.support import AbstractTkTest, AbstractDefaultRootTest, requires_tk
label_desc: Use image node_id 1 for calling a global function with example usage: _info_commands(widget, pattern) and returns: widget