Retrieve values for graphs.
173297
def retrieveVals(self):
        """"""
        for iface in self._ifaceList:
            if self._reqIfaceList is None or iface in self._reqIfaceList:
                if (self.graphEnabled('wanpipe_traffic') 
                    or self.graphEnabled('wanpipe_errors')):
                    stats = self._ifaceStats.get(iface)
                    if stats:
                        graph_name = 'wanpipe_traffic_%s' % iface
                        if self.hasGraph(graph_name):
                            for field in ('rxpackets', 'txpackets'):
                                self.setGraphVal(graph_name, field, 
                                                 stats.get(field))
                        graph_name = 'wanpipe_errors_%s' % iface
                        if self.hasGraph(graph_name):
                            for field in ('rxerrs', 'txerrs', 'rxframe', 'txcarrier',
                                'rxdrop', 'txdrop', 'rxfifo', 'txfifo'):
                                self.setGraphVal(graph_name, field, 
                                                 stats.get(field))
                if (self.graphEnabled('wanpipe_pri_errors') 
                    or self.graphEnabled('wanpipe_rxlevel')):
                    try:
                        stats = self._wanpipeInfo.getPRIstats(iface)
                    except:
                        stats = None
                    if stats:
                        graph_name = 'wanpipe_pri_errors_%s' % iface
                        if self.hasGraph(graph_name):
                            for field in ('linecodeviolation', 
                                          'farendblockerrors',
                                          'crc4errors', 'faserrors'):
                                self.setGraphVal(graph_name, field, 
                                                 stats.get(field))
                        if self.hasGraph('wanpipe_rxlevel'):
                            self.setGraphVal('wanpipe_pri_rxlevel', 
                                             iface, stats.get('rxlevel'))
769593
def get_graph_by_ids(self, network_ids: List[int]) -> BELGraph:
        """"""
        if len(network_ids) == 1:
            return self.get_graph_by_id(network_ids[0])

        log.debug('getting graph by identifiers: %s', network_ids)
        graphs = self.get_graphs_by_ids(network_ids)

        log.debug('getting union of graphs: %s', network_ids)
        rv = union(graphs)

        return rv
116711
def get_annotation_values(graph, annotation: str) -> Set[str]:
    
    return set(iter_annotation_values(graph, annotation))
777475
def get_values(self):
        

        results = requests.get(self.url).json()
        values = {}
        for entry in results:
            values[entry['visualProperty']] = entry['value']
        return values
1069250
def get_parameters(self, params, graph=None):
        
        g = graph if graph is not None else self.tf_graph

        with g.as_default():
            with tf.Session() as self.tf_session:
                self.tf_saver.restore(self.tf_session, self.model_path)
                out = {}
                for par in params:
                    if type(params[par]) == list:
                        for i, p in enumerate(params[par]):
                            out[par + '-' + str(i+1)] = p.eval()
                    else:
                        out[par] = params[par].eval()
                return out
764038
def assemble_graph():
    """"""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    stmts_json = body.get('statements')
    stmts = stmts_from_json(stmts_json)
    ga = GraphAssembler(stmts)
    model_str = ga.make_model()
    res = {'model': model_str}
    return res
64695
def values(self, **kwargs):
        """"""
        result = yield self.get(**kwargs)

        if not result['rows']:
            raise Return([])

        raise Return([x['value'] for x in result['rows']])
699297
def get_params(self):
        
        params = Data.get_params(self)
        params.update(BaseGraph.get_params(self))
        return params
328170
def retrieveVals(self):
        """"""
        ntpinfo = NTPinfo()
        ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
        if ntpstats:
            for host in self._remoteHosts:
                hostkey = re.sub('\.', '_', host)
                hoststats = ntpstats.get(host)
                if hoststats:
                    if self.hasGraph('ntp_host_stratums'):
                        self.setGraphVal('ntp_host_stratums', hostkey, 
                                         hoststats.get('stratum'))
                    if self.hasGraph('ntp_host_offsets'):
                        self.setGraphVal('ntp_host_offsets', hostkey, 
                                         hoststats.get('offset'))
                    if self.hasGraph('ntp_host_delays'):
                        self.setGraphVal('ntp_host_delays', hostkey, 
                                         hoststats.get('delay'))
956527
def graph(self, name, *args, **kwargs):
        
        return Graph(self, name, *args, **kwargs)
255762
def graphs(self):
        """"""
        result = Dummy()
        for graph in graphs.__all__:
            cls = getattr(graphs, graph)
            setattr(result, cls.short_name, cls(self))
        return result
1080544
def calculateValues(self):
        
        chart = self.chart()
        if not chart:
            return super(XDatasetAxis, self).calculateValues()
        else:
            values = []
            for dataset in chart.datasets():
                values.append(dataset.name())
            values.sort()
            return values
775730
def get_subgraphs_by_citation(graph):
    
    rv = defaultdict(graph.fresh_copy)

    for u, v, key, data in graph.edges(keys=True, data=True):
        if CITATION not in data:
            continue
        dk = data[CITATION][CITATION_TYPE], data[CITATION][CITATION_REFERENCE]

        rv[dk].add_edge(u, v, key=key, **data)

    cleanup(graph, rv)

    return dict(rv)
552724
def GetValues(self, fd):
    """"""
    result = None
    for result in fd.new_attributes.get(self, []):
      # We need to interpolate sub fields in this rdfvalue.
      if self.field_names:
        for x in self.GetSubFields(result, self.field_names):
          yield x

      else:
        yield result

    for result in fd.synced_attributes.get(self, []):
      result = result.ToRDFValue()

      # We need to interpolate sub fields in this rdfvalue.
      if result is not None:
        if self.field_names:
          for x in self.GetSubFields(result, self.field_names):
            yield x

        else:
          yield result

    if result is None:
      default = self.GetDefault(fd)
      if default is not None:
        yield default
1229414
def get_graphs_by_ids(self, network_ids: Iterable[int]) -> List[BELGraph]:
        """"""
        rv = [
            self.get_graph_by_id(network_id)
            for network_id in network_ids
        ]
        log.debug('returning graphs for network identifiers: %s', network_ids)
        return rv
1233217
def retrieveVals(self):
        """"""
        for iface in self._ifaceList:
            stats = self._ifaceStats.get(iface)
            graph_name = 'netiface_traffic_%s' % iface
            if self.hasGraph(graph_name):
                self.setGraphVal(graph_name, 'rx', stats.get('rxbytes') * 8)
                self.setGraphVal(graph_name, 'tx', stats.get('txbytes') * 8)
            graph_name = 'netiface_errors_%s' % iface
            if self.hasGraph(graph_name):
                for field in ('rxerrs', 'txerrs', 'rxframe', 'txcarrier',
                    'rxdrop', 'txdrop', 'rxfifo', 'txfifo'):
                    self.setGraphVal(graph_name, field, stats.get(field))
1212196
def retrieveVals(self):
        """"""
        ntpinfo = NTPinfo()
        stats = ntpinfo.getPeerStats()
        if stats:
            if self.hasGraph('ntp_peer_stratum'):
                self.setGraphVal('ntp_peer_stratum', 'stratum', 
                                 stats.get('stratum'))
            if self.hasGraph('ntp_peer_stats'):
                self.setGraphVal('ntp_peer_stats', 'offset', 
                                 stats.get('offset'))
                self.setGraphVal('ntp_peer_stats', 'delay', 
                                 stats.get('delay'))
                self.setGraphVal('ntp_peer_stats', 'jitter', 
                                 stats.get('jitter'))