code: def act(self, cmd_name, params=None):
          
  
          command = getattr(self, cmd_name)
          if params:
              command(params)
          else:
              command()
docs: Run the specified command with its parameters.