code: def cmd_ac(self, ch=None):
          
          viewer = self.get_viewer(ch)
          if viewer is None:
              self.log("No current viewer/channel.")
              return
  
          viewer.auto_levels()
          self.cmd_cuts(ch=ch)
docs: ac ch=chname
  
          Calculate and set auto cut levels for the given channel.
          If `ch` is omitted, assumes the current channel.