格式化词频统计信息
@param frequency 词频统计信息
777676
private String formatWordsFrequency(Map<String, AtomicInteger> frequency){
        StringBuilder str = new StringBuilder();
        if(frequency != null && !frequency.isEmpty()) {
            AtomicInteger c = new AtomicInteger();
            frequency
                    .entrySet()
                    .stream()
                    .sorted((a, b) -> b.getValue().get() - a.getValue().get())
                    .forEach(e -> str.append("\t").append(c.incrementAndGet()).append("、").append(e.getKey()).append("=").append(e.getValue()).append("\n"));
        }
        str.setLength(str.length()-1);
        return str.toString();
    }
817341
def ensure_frequencies(self, frequencies):
        """"""
        if not frequencies:
            return {}
        if not isinstance(frequencies, dict):
            raise ValueError("frequencies should be dict")
        frequencies = {
            host: Frequency.ensure_frequency(frequencies[host]) for host in frequencies
        }
        return frequencies
74162
def _validate_freq(self):
        
        from pandas.tseries.frequencies import to_offset
        try:
            return to_offset(self.window)
        except (TypeError, ValueError):
            raise ValueError("passed window {0} is not "
                             "compatible with a datetimelike "
                             "index".format(self.window))
516238
public com.google.api.ads.admanager.axis.v201808.FrequencyCap getFrequencyCap() {
        return frequencyCap;
    }
951852
def reset_frequencies(self, frequency=0):
        """"""

        frequency = max(frequency, 0)

        for key in self._store.keys():
            self._store[key] = (self._store[key][0], frequency)

        return frequency
993213
private void tickIfNecessary() {
        final long oldTick = lastTick.get();
        final long newTick = clock.tick();
        final long age = newTick - oldTick;
        if (age > TICK_INTERVAL) {
            final long newIntervalStartTick = newTick - age % TICK_INTERVAL;
            if (lastTick.compareAndSet(oldTick, newIntervalStartTick)) {
                final long requiredTicks = age / TICK_INTERVAL;
                for (long i = 0; i < requiredTicks; i++) {
                    m15Rate.tick();
                    m120Rate.tick();
                }
            }
        }
    }
301505
def AddFrequencyObject(self, frequency, problem_reporter):
    """"""
    if frequency is not None:
      self.AddFrequency(frequency.StartTime(),
                        frequency.EndTime(),
                        frequency.HeadwaySecs(),
                        frequency.ExactTimes(),
                        problem_reporter)
505797
def convert_frequency(frequency):
    
    number = int(re.findall('\d+', frequency)[0])
    unit = re.findall('[^\d]+', frequency)[0]
    if unit == 'h':
        number *= 60 * 60
    elif unit == 'm':
        number *= 60
    elif unit == 'd':
        number *= 60 * 60 * 24
    elif unit:
        raise FrequencyDefinitionError(unit)
    return number
1112180
def to_offset(freq):
    """"""
    if isinstance(freq, BaseCFTimeOffset):
        return freq
    else:
        try:
            freq_data = re.match(_PATTERN, freq).groupdict()
        except AttributeError:
            raise ValueError('Invalid frequency string provided')

    freq = freq_data['freq']
    multiples = freq_data['multiple']
    if multiples is None:
        multiples = 1
    else:
        multiples = int(multiples)

    return _FREQUENCIES[freq](n=multiples)
378339
function() {

        this.logger = Logger.getLogger("FreqItemset_js");
        var jvmObject = arguments[0];
        if (arguments.length > 1) {
            var items = Utils.unwrapObject(arguments[0]);
            if (Array.isArray(items)) {
                var list = new java.util.ArrayList();
                items.forEach(function(item){
                    list.add(Utils.unwrapObject(item));
                });
                items = list.toArray();
            }
            jvmObject = new org.apache.spark.mllib.fpm.FPGrowth.FreqItemset(items, arguments[1]);
        }
        JavaWrapper.call(this, jvmObject);

    }
544284
def ref_frequency(self, context):
        
        num_chans = self._manager.spectral_window_table.getcol(MS.NUM_CHAN)
        ref_freqs = self._manager.spectral_window_table.getcol(MS.REF_FREQUENCY)

        data = np.hstack((np.repeat(rf, bs) for bs, rf in zip(num_chans, ref_freqs)))
        return data.reshape(context.shape).astype(context.dtype)
1286876
public void setData (int format, ByteBuffer data, int frequency)
    {
        AL10.alBufferData(_id, format, data, frequency);
    }
1156314
void addProviderInfoListener(String dataId, ConsumerConfig consumerConfig,
                                 ProviderInfoListener listener) {
        providerInfoListeners.put(consumerConfig, listener);

        // 同一个key重复订阅多次，提醒用户需要检查一下是否是代码问题
        if (LOGGER.isWarnEnabled(consumerConfig.getAppName()) && providerInfoListeners.size() > 5) {
            LOGGER.warnWithApp(consumerConfig.getAppName(),
                "Duplicate to add provider listener of {} " +
                    "more than 5 times, now is {}, please check it",
                dataId, providerInfoListeners.size());
        }
    }
262774
public function setFrequency(int $frequency): AlarmInterface
    {
        $recurrence = "ON_";
        foreach ($this->days as $key => $val) {
            if ($frequency & $val) {
                $recurrence .= $key;
            }
        }

        if ($recurrence === "ON_") {
            $recurrence = "ONCE";
        } elseif ($recurrence === "ON_0123456") {
            $recurrence = "DAILY";
        } elseif ($recurrence === "ON_01234") {
            $recurrence = "WEEKDAYS";
        } elseif ($recurrence === "ON_56") {
            $recurrence = "WEEKENDS";
        }

        $this->attributes["Recurrence"] = $recurrence;

        return $this->save();
    }
306127
public void setOfflineUpdateFrequency(String offlineUpdateFrequency) {

        try {
            setOfflineUpdateFrequency(Long.parseLong(offlineUpdateFrequency));
        } catch (Exception e) {
            LOG.error(
                Messages.get().getBundle().key(
                    Messages.LOG_PARSE_OFFLINE_UPDATE_FAILED_2,
                    offlineUpdateFrequency,
                    new Long(DEFAULT_OFFLINE_UPDATE_FREQNENCY)),
                e);
            setOfflineUpdateFrequency(DEFAULT_OFFLINE_UPDATE_FREQNENCY);
        }
    }
68627
def frequencyRedefinition(CellChannelDescription_presence=0):
    """"""
    a = TpPd(pd=0x6)
    b = MessageType(mesType=0x14)  # 00010100
    c = ChannelDescription()
    d = MobileAllocation()
    e = StartingTime()
    packet = a / b / c / d / e
    if CellChannelDescription_presence is 1:
        f = CellChannelDescriptionHdr(ieiCCD=0x62, eightBitCCD=0x0)
        packet = packet / f
    return packet
1259128
public void infof(Throwable t, String format, Object... params) {
        doLogf(Level.INFO, FQCN, format, params, t);
    }