Gets the idle PC proposals.
        Takes 1000 measurements and records up to 10 idle PC proposals.
        There is a 10ms wait between each measurement.

        :returns: list of idle PC proposal
976752
def get_idle_pc_prop(self):
        

        is_running = yield from self.is_running()
        was_auto_started = False
        if not is_running:
            yield from self.start()
            was_auto_started = True
            yield from asyncio.sleep(20)  # leave time to the router to boot

        log.info('Router "{name}" [{id}] has started calculating Idle-PC values'.format(name=self._name, id=self._id))
        begin = time.time()
        idlepcs = yield from self._hypervisor.send('vm get_idle_pc_prop "{}" 0'.format(self._name))
        log.info('Router "{name}" [{id}] has finished calculating Idle-PC values after {time:.4f} seconds'.format(name=self._name,
                                                                                                                  id=self._id,
                                                                                                                  time=time.time() - begin))
        if was_auto_started:
            yield from self.stop()
        return idlepcs
486879
def idle_connections(self):
        
        return [c for c in self.connections.values()
                if not c.busy and not c.closed]
870283
def get_records(self):
        
        # Won't be able to find new records.
        if self.exhausted:
            return []

        # Already caught up, just the one call please.
        if self.empty_responses >= CALLS_TO_REACH_HEAD:
            return self._apply_get_records_response(self.session.get_stream_records(self.iterator_id))

        # Up to 5 calls to try and find a result
        while self.empty_responses < CALLS_TO_REACH_HEAD and not self.exhausted:
            records = self._apply_get_records_response(self.session.get_stream_records(self.iterator_id))
            if records:
                return records

        return []
148765
def get_methods(self, limit=10000):
        
        if self.methods is None:
            self._init_methods(limit)
        return self.methods
75182
def list(self):
        

        # We have to open this queue before we make the request, to ensure we don't miss the response.
        queue = self._pebble.get_endpoint_queue(DataLogging)

        self._pebble.send_packet(DataLogging(data=DataLoggingReportOpenSessions(sessions=[])))

        sessions = []
        while True:
            try:
                result = queue.get(timeout=2).data
            except TimeoutError:
                break
            if isinstance(result, DataLoggingDespoolOpenSession):
                self._pebble.send_packet(DataLogging(data=DataLoggingACK(
                                                     session_id=result.session_id)))
                sessions.append(result.__dict__)

        queue.close()
        return sessions
264908
def get_projects(machine):
    

    query = Project.active.all()
    return [x.pid for x in query]
744855
def get_raw_data(self, times=5):
        

        self._validate_measure_count(times)

        data_list = []
        while len(data_list) < times:
            data = self._read()
            if data not in [False, -1]:
                data_list.append(data)

        return data_list
843079
def idle_task(self):
        ''''''
        now = time.time()
        time_delta = now - self.last_calc
        if time_delta > 1:
            self.last_calc = now
            self.buckets.append(self.counts)
            self.counts = {}
            if len(self.buckets) > self.max_buckets:
                self.buckets = self.buckets[-self.max_buckets:]
1012602
def getMonitors(self, apikey, monitors='none'):
        """"""
        data= 'api_key=' + apikey + '&format=json'
        if monitors != 'none':
            data += '&monitors=' + monitors
        fetchUrl = self.BASE_URL
        fetchUrl += 'getMonitors'
        try:
            monitors = requests.post(fetchUrl,
                headers=self.headers, data=data, timeout=3)
        except:
            return False
        else:
            if monitors:
                return monitors.json()
            else:
                return False
386489
List<List<Measurement>> getBatches() {
    List<List<Measurement>> batches = new ArrayList<>();
    List<Measurement> ms = getMeasurements().collect(Collectors.toList());
    for (int i = 0; i < ms.size(); i += batchSize) {
      List<Measurement> batch = ms.subList(i, Math.min(ms.size(), i + batchSize));
      batches.add(batch);
    }
    return batches;
  }
215863
private Iterable<PutMetricDataRequest> toPutMetricDataRequests(Map<String, MetricDatum> uniqueMetrics) {
        // Opportunistically generates some machine metrics whenever there
        // is metrics consolidation
        for (MetricDatum datum: machineMetricFactory.generateMetrics()) {
            summarize(datum, uniqueMetrics);
        }
        List<PutMetricDataRequest> list = new ArrayList<PutMetricDataRequest>();
        List<MetricDatum> data = new ArrayList<MetricDatum>();
        for (MetricDatum m: uniqueMetrics.values()) {
            data.add(m);
            if (data.size() == CloudWatchMetricConfig.MAX_METRICS_DATUM_SIZE) {
                list.addAll(newPutMetricDataRequests(data));
                data.clear();
            }
        }

        if (data.size() > 0) {
            list.addAll(newPutMetricDataRequests(data));
        }
        return list;
    }
877599
def SurveyOptions(self):
        
        list_of_measures = []
        if self.et.find("SurveyOptions") is None:
            return list_of_measures
        return self._get_measures(self.et.find("SurveyOptions"))
408534
def records(self):
        
        if self._records is None:
            self._records = RecordList(self._version, account_sid=self._solution['account_sid'], )
        return self._records
1095844
def GetValues(self):
    
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if self._registry_key:
      return self._registry_key.GetValues()

    return iter([])
324485
def _get_batch_requests(self, timeout=None):
        """"""
        reqs = []
        s = time()
        while len(reqs) < self.batch_size and (time() - s) < timeout:
            try:
                req = self.queue.get(block=False)
                self.queue.task_done()

                reqs.append(req)
            except Empty as ex:
                if self.stop_flag:
                    break
                else:
                    sleep(0.1)

        if not reqs:
            raise Empty
        elif len(reqs) <= 1:
            return reqs[0]
        else:
            logitems = []
            req = reqs[0]
            for req in reqs:
                logitems.extend(req.get_log_items())

            ret = PutLogsRequest(self.project, self.log_store, req.topic, logitems=logitems)
            ret.__record__ = req.__record__

            return ret
117812
def get_suggestions(self, iteration_config=None):
        
        matrix = self.hptuning_config.matrix

        suggestions = []
        keys = list(matrix.keys())
        values = [v.to_numpy() for v in matrix.values()]
        for v in itertools.product(*values):
            suggestions.append(dict(zip(keys, v)))

        if self.hptuning_config.grid_search:
            n_suggestions = self.hptuning_config.grid_search.n_experiments
            if n_suggestions:
                return suggestions[:n_suggestions]
        return suggestions
1219506
def list_surveys():  # noqa: E501
    
    pm = PrecisionMapper(login=_LOGIN, password=_PASSWORD)
    pm.sign_in()
    surveys = pm.get_surveys()
    shared_surveys = pm.get_shared_surveys()

    survey_list = []
    for survey in surveys+shared_surveys:
        survey_obj = Survey(
            date=survey.date, image_nb=survey.image_nb,
            location=survey.location, name=survey.name,
            sensors=survey.sensor, size=survey.size, survey_id=survey.id)
        survey_list.append(survey_obj)
    return survey_list