use this function to set series/episodes active state in bunch
16170
public function setSeriesState($series, $state = 10)
    {
        switch ($state) {
            case $this::SERIES_STATE_ALL_ACTIVE:
                $this->setState($series, true, true);
                break;
            case $this::SERIES_STATE_ALL_INACTIVE:
                $this->setState($series, false, false);
                break;
            case $this::SERIES_STATE_SERIES_ACTIVE_ONLY:
                $this->setState($series, true, false);
                break;
            case $this::SERIES_STATE_EPISODES_ACTIVE_ONLY:
                $this->setState($series, false, true);
                break;
            default:
                break;
        }
    }
255094
def assign_to_series(self, name, series_type, item):
        """"""
        if series_type == "(":
            self.add_def(name + " = _coconut.tuple(" + item + ")")
        elif series_type == "[":
            self.add_def(name + " = _coconut.list(" + item + ")")
        else:
            raise CoconutInternalException("invalid series match type", series_type)
605056
private static void processSeasonEpisodes(Element eEpisodeList, EpisodeList epList) {
        // Get the season number
        String season = eEpisodeList.getAttribute("no");

        NodeList nlEpisode = eEpisodeList.getElementsByTagName(EPISODE);
        if (nlEpisode == null || nlEpisode.getLength() == 0) {
            return;
        }

        for (int eLoop = 0; eLoop < nlEpisode.getLength(); eLoop++) {
            Node nEpisode = nlEpisode.item(eLoop);
            if (nEpisode.getNodeType() == Node.ELEMENT_NODE) {
                epList.addEpisode(parseEpisode((Element) nEpisode, season));
            }
        }

    }
192053
def setShowSubProgress( self, state ):
        
        ajax = self.currentMode() == XLoaderWidget.Mode.Spinner
        self._showSubProgress = state
        self._subProgressBar.setVisible(not ajax and state)
114744
def active_multiplex(self, state: 'State') -> Tuple['Multiplex']:
        
        return tuple(multiplex for multiplex in self.multiplexes if multiplex.is_active(state))
80782
def _content_function(self):
        
        # ensure that active is valid
        self.active = self.active % len(self.items)

        return set([self.items[self.active]])
464641
def reset(self):
        
        self.interval_start = timeit.default_timer()
        self.progbar = Progbar(target=self.interval)
        self.metrics = []
        self.infos = []
        self.info_names = None
        self.episode_rewards = []
1294563
def prepare_stateseries(self, ramflag: bool = True) -> None:
        """"""
        for element in printtools.progressbar(self):
            element.prepare_stateseries(ramflag)
67261
def addthisbunch(bunchdt, data, commdct, thisbunch, theidf):
    """"""
    key = thisbunch.key.upper()
    obj = copy.copy(thisbunch.obj)
    abunch = obj2bunch(data, commdct, obj)
    bunchdt[key].append(abunch)
    return abunch
388451
def new_media_status(self, media_status):
        """"""
        casts = self._casts
        group_members = self._mz.members
        for member_uuid in group_members:
            if member_uuid not in casts:
                continue
            for listener in list(casts[member_uuid]['listeners']):
                listener.multizone_new_media_status(
                    self._group_uuid, media_status)
19125
def scene_active(sequence_number, scene_id):
        """"""
        return MessageWriter().string("scene.setactive").uint64(sequence_number).uint32(scene_id).get()
371207
private void setSeriesStyles() {

    SeriesColorMarkerLineStyleCycler seriesColorMarkerLineStyleCycler =
        new SeriesColorMarkerLineStyleCycler(
            getStyler().getSeriesColors(),
            getStyler().getSeriesMarkers(),
            getStyler().getSeriesLines());
    for (Series series : getSeriesMap().values()) {

      SeriesColorMarkerLineStyle seriesColorMarkerLineStyle =
          seriesColorMarkerLineStyleCycler.getNextSeriesColorMarkerLineStyle();

      if (series.getFillColor() == null) { // wasn't set manually
        series.setFillColor(seriesColorMarkerLineStyle.getColor());
      }
    }
  }
103119
def bump(db, aid):
    """"""
    anime = lookup(db, aid)
    if anime.complete:
        return
    episode = anime.watched_episodes + 1
    with db:
        set_watched(db, aid, get_eptype(db, 'regular').id, episode)
        set_status(
            db, aid,
            anime.enddate and episode >= anime.episodecount,
            episode)
683963
def set_state_batch(keys, values, namespace=None, ttl=3600*24*365):
    """"""

    keys, values = zip(*{k: v for k, v in zip(keys, values)}.items())

    if namespace:
        keys = ["{}:{}".format(namespace, key) for key in keys]

    return set_item_batch(keys, values, ttl)
1372675
def begin_episode(self, agent_indices):
    
    with tf.name_scope('begin_episode/'):
      if self._last_state is None:
        reset_state = tf.no_op()
      else:
        reset_state = utility.reinit_nested_vars(
            self._last_state, agent_indices)
      reset_buffer = self._current_episodes.clear(agent_indices)
      with tf.control_dependencies([reset_state, reset_buffer]):
        return tf.constant('')
1089153
def set_active(self, active):
        """"""
        url = CONST.AUTOMATION_EDIT_URL
        url = url.replace(
            '$AUTOMATIONID$', self.automation_id)

        self._automation['is_active'] = str(int(active))

        response = self._abode.send_request(
            method="put", url=url, data=self._automation)

        response_object = json.loads(response.text)

        if isinstance(response_object, (tuple, list)):
            response_object = response_object[0]

        if (str(response_object['id']) != str(self._automation['id']) or
                response_object['is_active'] != self._automation['is_active']):
            raise AbodeException((ERROR.INVALID_AUTOMATION_EDIT_RESPONSE))

        self.update(response_object)

        return True
272352
def on_episode_begin(self, episode, logs):
        
        self.episode_start[episode] = timeit.default_timer()
        self.observations[episode] = []
        self.rewards[episode] = []
        self.actions[episode] = []
        self.metrics[episode] = []