Main screen for channel management.
        Channels listed and operations can be chosen on the screen.
        If there is an error message like non-choice,
        it is shown here.
493091
def channel_list(self):
        

        if self.current.task_data.get('msg', False):
            if self.current.task_data.get('target_channel_key', False):
                self.current.output['msgbox'] = {'type': 'info',
                                                 "title": _(u"Successful Operation"),
                                                 "msg": self.current.task_data['msg']}
                del self.current.task_data['msg']
            else:
                self.show_warning_messages()

        self.current.task_data['new_channel'] = False
        _form = ChannelListForm(title=_(u'Public Channel List'), help_text=CHANNEL_CHOICE_TEXT)

        for channel in Channel.objects.filter(typ=15):
            owner_name = channel.owner.username
            _form.ChannelList(choice=False, name=channel.name, owner=owner_name, key=channel.key)

        _form.new_channel = fields.Button(_(u"Merge At New Channel"), cmd="create_new_channel")
        _form.existing_channel = fields.Button(_(u"Merge With An Existing Channel"),
                                               cmd="choose_existing_channel")
        _form.find_chosen_channel = fields.Button(_(u"Split Channel"), cmd="find_chosen_channel")
        self.form_out(_form)
1228489
def open_channel(self):
        
        logger.info('Creating a new channel')
        self._connection.channel(on_open_callback=self.on_channel_open)
72974
def select(self, nowait=True, cb=None):
        '''
        
        '''
        nowait = nowait and self.allow_nowait() and not cb

        if not self._enabled:
            self._enabled = True
            self.channel.basic._msg_id = 0
            self.channel.basic._last_ack_id = 0
            args = Writer()
            args.write_bit(nowait)

            self.send_frame(MethodFrame(self.channel_id, 85, 10, args))

            if not nowait:
                self._select_cb.append(cb)
                self.channel.add_synchronous_cb(self._recv_select_ok)
119637
def channels_for_role(role):
    
    chans = []
    chans_names = []
    # default channels
    if role == "public":
        if ENABLE_PUBLIC_CHANNEL is True:
            chan = dict(slug=PUBLIC_CHANNEL, path=None)
            chans.append(chan)
            chans_names.append(PUBLIC_CHANNEL)
    elif role == "users":
        if ENABLE_USERS_CHANNEL is True:
            chan = _ensure_channel_is_private(DEFAULT_USERS_CHANNEL)
            chan = dict(slug=chan, path=None)
            chans.append(chan)
            chans_names.append(DEFAULT_USERS_CHANNEL)
    elif role == "staff":
        if ENABLE_STAFF_CHANNEL is True:
            chan = _ensure_channel_is_private(DEFAULT_STAFF_CHANNEL)
            chan = dict(slug=chan, path=None)
            chans.append(chan)
            chans_names.append(DEFAULT_STAFF_CHANNEL)
    elif role == "superuser":
        if ENABLE_SUPERUSER_CHANNEL is True:
            chan = _ensure_channel_is_private(DEFAULT_SUPERUSER_CHANNEL)
            chan = dict(slug=chan, path=None)
            chans.append(chan)
            chans_names.append(DEFAULT_SUPERUSER_CHANNEL)
    # declared channels
    if role == "public":
        if len(PUBLIC_CHANNELS) > 0:
            for chanconf in PUBLIC_CHANNELS:
                chan = _check_chanconf(chanconf, False)
                chans.append(chan)
                chans_names.append(chan["slug"])
    elif role == "users":
        if len(USERS_CHANNELS) > 0:
            for chanconf in USERS_CHANNELS:
                chan = _check_chanconf(chanconf)
                chans.append(chan)
                chans_names.append(chan["slug"])
    elif role == "staff":
        if len(STAFF_CHANNELS) > 0:
            for chanconf in STAFF_CHANNELS:
                chan = _check_chanconf(chanconf)
                chans.append(chan)
                chans_names.append(chan["slug"])
    elif role == "superuser":
        if len(SUPERUSER_CHANNELS) > 0:
            for chanconf in SUPERUSER_CHANNELS:
                chan = _check_chanconf(chanconf)
                chans.append(chan)
                chans_names.append(chan["slug"])
    return chans, chans_names
1321951
def on_channel_open(self, channel):
        
        self._logger.debug('Channel opened')
        self._channel = channel
        self._channel.parent_client = self
        self.add_on_channel_close_callback()
        self.setup_exchange(self._exchange)
997077
def system_channel(self):
        
        channel_id = self._system_channel_id
        return channel_id and self._channels.get(channel_id)
632012
def cmd_part(self, connection, sender, target, payload):
        
        if payload:
            connection.part(payload)
        else:
            raise ValueError("No channel given")
1273366
public static void showChannels(Object... channels){
    // TODO this could share more code with the other show/hide(Only)Channels methods
    for(LogRecordHandler handler : handlers){
      if(handler instanceof VisibilityHandler){
        VisibilityHandler visHandler = (VisibilityHandler) handler;
        for (Object channel : channels) {
          visHandler.alsoShow(channel);
        }
      }
    }
  }
420370
def update_channels(self):
        
        if not self.gui_up:
            return

        self.logger.debug("channel configuration has changed--updating gui")
        try:
            channel = self.fv.get_channel(self.chname)

        except KeyError:
            channel = self.fv.get_channel_info()

        if channel is None:
            raise ValueError('No channel available')

        self.chname = channel.name

        w = self.w.channel_name
        w.clear()

        self.chnames = list(self.fv.get_channel_names())
        #self.chnames.sort()
        for chname in self.chnames:
            w.append_text(chname)

        # select the channel that is the current one
        try:
            i = self.chnames.index(channel.name)
        except IndexError:
            i = 0
        self.w.channel_name.set_index(i)

        # update the image listing
        self.redo()
841244
def allow(self, channel, message):
		
		return all(
			filter(channel, message)
			for filter in _load_filters()
		)
125019
protected static function showHelp()
    {
        \cli\line();
        \cli\out(self::$arguments->getHelpScreen(\cli\Colors::colorize('%N%n%gAvailable commands:')));
        \cli\line();
    }
1280389
def select(self, cb=None):
        '''
        
        '''
        if not self._enabled:
            self._enabled = True
            self.send_frame(MethodFrame(self.channel_id, 90, 10))
            self._select_cb.append(cb)
            self.channel.add_synchronous_cb(self._recv_select_ok)
908821
def task_channels(self):
        
        if self._task_channels is None:
            self._task_channels = TaskChannelList(self._version, workspace_sid=self._solution['sid'], )
        return self._task_channels
982331
def cmd_lsch(self):
        
        names = list(self.fv.get_channel_names())
        names.sort()

        if len(names) == 0:
            self.log("No channels")
            return

        res = []
        cur_ch = self.fv.get_channel_info()
        for name in names:
            if (cur_ch is not None) and (cur_ch.name == name):
                res.append("=>%s" % (name))
            else:
                res.append("  %s" % (name))

        self.log("\n".join(res))
76201
def create_widgets(MAIN):
    

    """ ------ CREATE WIDGETS ------ """
    MAIN.labels = Labels(MAIN)
    MAIN.channels = Channels(MAIN)
    MAIN.notes = Notes(MAIN)
    MAIN.merge_dialog = MergeDialog(MAIN)
    MAIN.export_events_dialog = ExportEventsDialog(MAIN)
    MAIN.export_dataset_dialog = ExportDatasetDialog(MAIN)
    MAIN.spindle_dialog = SpindleDialog(MAIN)
    MAIN.slow_wave_dialog = SWDialog(MAIN)
    MAIN.analysis_dialog = AnalysisDialog(MAIN)
    #MAIN.plot_dialog = PlotDialog(MAIN)
    MAIN.overview = Overview(MAIN)
    MAIN.spectrum = Spectrum(MAIN)
    MAIN.traces = Traces(MAIN)
    MAIN.video = Video(MAIN)
    MAIN.settings = Settings(MAIN)  # depends on all widgets apart from Info
    MAIN.info = Info(MAIN)  # this has to be the last, it depends on settings

    MAIN.setCentralWidget(MAIN.traces)

    """ ------ LIST DOCKWIDGETS ------ """
    new_docks = [{'name': 'Information',
                  'widget': MAIN.info,
                  'main_area': Qt.LeftDockWidgetArea,
                  'extra_area': Qt.RightDockWidgetArea,
                  },
                 {'name': 'Labels',
                  'widget': MAIN.labels,
                  'main_area': Qt.RightDockWidgetArea,
                  'extra_area': Qt.LeftDockWidgetArea,
                  },
                 {'name': 'Channels',
                  'widget': MAIN.channels,
                  'main_area': Qt.RightDockWidgetArea,
                  'extra_area': Qt.LeftDockWidgetArea,
                  },
                 {'name': 'Spectrum',
                  'widget': MAIN.spectrum,
                  'main_area': Qt.RightDockWidgetArea,
                  'extra_area': Qt.LeftDockWidgetArea,
                  },
                 {'name': 'Annotations',
                  'widget': MAIN.notes,
                  'main_area': Qt.LeftDockWidgetArea,
                  'extra_area': Qt.RightDockWidgetArea,
                  },
                 {'name': 'Video',
                  'widget': MAIN.video,
                  'main_area': Qt.LeftDockWidgetArea,
                  'extra_area': Qt.RightDockWidgetArea,
                  },
                 {'name': 'Overview',
                  'widget': MAIN.overview,
                  'main_area': Qt.BottomDockWidgetArea,
                  'extra_area': Qt.TopDockWidgetArea,
                  },
                 ]

    """ ------ CREATE DOCKWIDGETS ------ """
    idx_docks = {}
    actions = MAIN.action

    actions['dockwidgets'] = []
    for dock in new_docks:
        dockwidget = QDockWidget(dock['name'], MAIN)
        dockwidget.setWidget(dock['widget'])
        dockwidget.setAllowedAreas(dock['main_area'] | dock['extra_area'])
        dockwidget.setObjectName(dock['name'])  # savestate

        idx_docks[dock['name']] = dockwidget
        MAIN.addDockWidget(dock['main_area'], dockwidget)

        dockwidget_action = dockwidget.toggleViewAction()
        dockwidget_action.setIcon(QIcon(ICON['widget']))

        actions['dockwidgets'].append(dockwidget_action)

    """ ------ ORGANIZE DOCKWIDGETS ------ """
    MAIN.tabifyDockWidget(idx_docks['Information'],
                          idx_docks['Video'])
    MAIN.tabifyDockWidget(idx_docks['Channels'],
                          idx_docks['Labels'])
    idx_docks['Information'].raise_()
1278279
function ChoiceManager() {
        var that;
        that = this;

        /**
         * ### ChoiceManager.dl
         *
         * The clickable list containing all the forms
         */
        this.dl = null;

        /**
         * ### ChoiceManager.mainText
         *
         * The main text introducing the choices
         *
         * @see ChoiceManager.spanMainText
         */
        this.mainText = null;

        /**
         * ### ChoiceManager.spanMainText
         *
         * The span containing the main text
         */
        this.spanMainText = null;

        /**
         * ### ChoiceManager.forms
         *
         * The array available forms
         *
         * @see ChoiceManager.formsById
         */
        this.forms = null;

        /**
         * ### ChoiceManager.forms
         *
         * A map form id to form
         *
         * Note: if a form does not have an id, it will not be added here.
         *
         * @see ChoiceManager.forms
         */
        this.formsById = null;

        /**
         * ### ChoiceManager.order
         *
         * The order of the forms as displayed (if shuffled)
         */
        this.order = null;

        /**
         * ### ChoiceManager.shuffleForms
         *
         * TRUE, if forms have been shuffled
         */
        this.shuffleForms = null;

        /**
         * ### ChoiceManager.group
         *
         * The name of the group where the list belongs, if any
         */
        this.group = null;

        /**
         * ### ChoiceManager.groupOrder
         *
         * The order of the list within the group
         */
        this.groupOrder = null;

        /**
         * ### ChoiceManager.formsOptions
         *
         * An object containing options to be added to every form
         *
         * Options are added only if forms are specified as object literals,
         * and can be overriden by each individual form.
         */
        this.formsOptions =  {
            title: false,
            frame: false,
            storeRef: false
        };

        /**
         * ### ChoiceManager.freeText
         *
         * If truthy, a textarea for free-text comment will be added
         *
         * If 'string', the text will be added inside the the textarea
         */
        this.freeText = null;

        /**
         * ### ChoiceManager.textarea
         *
         * Textarea for free-text comment
         */
        this.textarea = null;
    }
1235557
def no_results(channel):
    

    gui = ui_embed.UI(
        channel,
        "No results",
        ":c",
        modulename=modulename,
        colour=0xFF8800
    )

    return gui