Get a list of RunStates from the ZoneMinder API.
439900
def get_run_states(self) -> List[RunState]:
        """"""
        raw_states = self.get_state('api/states.json')
        if not raw_states:
            _LOGGER.warning("Could not fetch runstates from ZoneMinder")
            return []

        run_states = []
        for i in raw_states['states']:
            raw_state = i['State']
            _LOGGER.info("Initializing runstate %s", raw_state['Id'])
            run_states.append(RunState(self, raw_state))

        return run_states
1170399
def GetRunlevelsNonLSB(states):
  """"""
  if not states:
    return set()
  convert_table = {
      "0": "0",
      "1": "1",
      "2": "2",
      "3": "3",
      "4": "4",
      "5": "5",
      "6": "6",
      # SysV, Gentoo, Solaris, HP-UX all allow an alpha variant
      # for single user. https://en.wikipedia.org/wiki/Runlevel
      "S": "1",
      "s": "1"
  }
  _LogInvalidRunLevels(states, convert_table)
  return set([convert_table[s] for s in states.split() if s in convert_table])
1274470
def get_run_events(cls, crawler, run_id, start, end, level=None):
        """"""
        key = make_key(crawler, "events", run_id, level)
        return cls.event_list(key, start, end)
1341811
def states(self):
        """"""
        state_list = []
        for state in States:
            if state.value & self._states != 0:
                state_list.append(state)

        if (self._flashing_states & States.FILTER) != 0:
            state_list.append(States.FILTER_LOW_SPEED)

        return state_list
422431
private static synchronized String[] getZoneIDs() {
        if (ZONEIDS == null) {
            try {
                UResourceBundle top = UResourceBundle.getBundleInstance(
                        ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
                ZONEIDS = top.getStringArray(kNAMES);
            } catch (MissingResourceException ex) {
                // throw away..
            }
        }
        if (ZONEIDS == null) {
            ZONEIDS = new String[0];
        }
        return ZONEIDS;
    }
979265
@Nonnull
    public List<S> bfsStates() {
        List<S> stateList = new ArrayList<>();
        Set<S> visited = new HashSet<>();

        int ptr = 0;
        stateList.add(root);
        visited.add(root);
        int numStates = 1;

        while (ptr < numStates) {
            S curr = stateList.get(ptr++);
            for (int i = 0; i < alphabetSize; i++) {
                S succ = curr.getSuccessor(i);
                if (succ != null && visited.add(succ)) {
                    stateList.add(succ);
                    numStates++;
                }
            }
        }

        return stateList;
    }
1194416
def async_get_ac_states(self, uid, limit=1, offset=0, fields='*'):
        """"""
        return (yield from self._get('/pods/{}/acStates'.format(uid),
                                     limit=limit,
                                     fields=fields,
                                     offset=offset))
863680
def _get_instance_state(self):
        
        instance = self._get_instance()
        statuses = instance.instance_view.statuses

        for status in statuses:
            if status.code.startswith('PowerState'):
                return status.display_status
228596
def Runs(self):
    
    with self._accumulators_mutex:
      # To avoid nested locks, we construct a copy of the run-accumulator map
      items = list(six.iteritems(self._accumulators))
    return {run_name: accumulator.Tags() for run_name, accumulator in items}
164739
def get_guardians(self, run):
        
        if run in self._graph.nodes():
            return list(self._graph.predecessors(run))
        else:
            return []
1219022
def get_state_batch(keys, namespace=None, consistent=True):
    """"""

    ukeys = set(keys)

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

    uvalues = {k: v for k, v
               in zip(ukeys, get_item_batch(ns_keys, consistent=consistent))}
    return list(zip(keys, (uvalues[k] for k in keys)))
348408
def list_():
    '''
    

    '''
    ret = []
    states_path = _states_path()
    if not os.path.isdir(states_path):
        return ret

    for state in os.listdir(states_path):
        if state.endswith(('-pkgs.yml', '-reps.yml')):
            # Remove the suffix, as both share the same size
            ret.append(state[:-9])
    return sorted(set(ret))
561562
def running_state(self, running_state):
        
        allowed_values = ["ONGOING", "PENDING", "ENDED"]  # noqa: E501
        if running_state not in allowed_values:
            raise ValueError(
                "Invalid value for `running_state` ({0}), must be one of {1}"  # noqa: E501
                .format(running_state, allowed_values)
            )

        self._running_state = running_state
562879
def _collect_state_names(self, variable):
        ""
        states = sorted(list(self.data.ix[:, variable].dropna().unique()))
        return states
1304099
def get_trackrs(self):
        
        trackrs = []
        for trackr in self.state:
            trackrs.append(trackrDevice(trackr, self))
        return trackrs
1122341
private Set<String> parseInstanceStates(final Map<String, String[]> queryParams) {
        Set<String> instanceStates = new TreeSet<String>();

        for (String queryKey : queryParams.keySet()) {
            // e.g. Filter.1.Value.1: running, Filter.1.Value.2: pending
            if (queryKey.startsWith("Filter.1.Value")) {
                for (String state : queryParams.get(queryKey)) {
                    instanceStates.add(state);
                }
            }
        }
        return instanceStates;
    }
871600
private static List<SessionStatus> getEndStates() {
    List<SessionStatus> endStatesRet = new ArrayList<SessionStatus>();
    for (SessionStatus s : SessionStatus.values()) {
      if (s != SessionStatus.RUNNING) {
        endStatesRet.add(s);
      }
    }
    return endStatesRet;
  }