code: def toggle_shells(command, enable):
      
      selection = list(selected_shells(command))
      if command and command != '*' and selection:
          for i in selection:
              if i.state != remote_dispatcher.STATE_DEAD and i.enabled != enable:
                  break
          else:
              toggle_shells('*', not enable)
  
      for i in selection:
          if i.state != remote_dispatcher.STATE_DEAD:
              i.set_enabled(enable)
docs: Enable or disable the specified shells. If the command would have
      no effect, it changes all other shells to the inverse enable value.