code: def list_commands(self, context):
      command_names = []
  
      commands_pathname = cellprofiler_core.commands.__file__
  
      commands_directory = pathlib.Path(commands_pathname).parent
  
      for filename in os.listdir(commands_directory):
          if filename.endswith("_command.py") and filename.startswith(
              "_"
          ):
              command_name = filename[1:-11]
  
              command_names += [command_name]
  
      command_names.sort()
  
      return command_names
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/__main__.py
imports: import os
  import pathlib
  import click
  import cellprofiler_core.commands
label_desc: Use image node_id 2 for calling the Command obj's underlying member method code with example usage: obj.list_commands(context) and returns: command_names