Collect masters map from the network.
        :return:
501541
def _collect_masters_map(self, response):
        '''
        
        '''
        while True:
            try:
                data, addr = self._socket.recvfrom(0x400)
                if data:
                    if addr not in response:
                        response[addr] = []
                    response[addr].append(data)
                else:
                    break
            except Exception as err:
                if not response:
                    self.log.error('Discovery master collection failure: %s', err)
                break
925690
def get_mappings_in_network(network_id, network_2_id=None, **kwargs):
    
    qry = db.DBSession.query(ResourceAttrMap).filter(or_(ResourceAttrMap.network_a_id == network_id, ResourceAttrMap.network_b_id == network_id))

    if network_2_id is not None:
        qry = qry.filter(or_(ResourceAttrMap.network_a_id==network_2_id, ResourceAttrMap.network_b_id==network_2_id))

    return qry.all()
1233389
def _master_tops(self):
        '''
        
        '''
        if 'id' not in self.opts:
            log.error('Received call for external nodes without an id')
            return {}
        if not salt.utils.verify.valid_id(self.opts, self.opts['id']):
            return {}
        # Evaluate all configured master_tops interfaces

        grains = {}
        ret = {}

        if 'grains' in self.opts:
            grains = self.opts['grains']
        for fun in self.tops:
            if fun not in self.opts.get('master_tops', {}):
                continue
            try:
                ret.update(self.tops[fun](opts=self.opts, grains=grains))
            except Exception as exc:
                # If anything happens in the top generation, log it and move on
                log.error(
                    'Top function %s failed with error %s for minion %s',
                    fun, exc, self.opts['id']
                )
        return ret
1278962
def master(self):
        ''''''
        if len(self.mav_master) == 0:
              return None
        if self.settings.link > len(self.mav_master):
            self.settings.link = 1
        # try to use one with no link error
        if not self.mav_master[self.settings.link-1].linkerror:
            return self.mav_master[self.settings.link-1]
        for m in self.mav_master:
            if not m.linkerror:
                return m
        return self.mav_master[self.settings.link-1]
809570
def gather_master_data(stackname)
      response = fetch_master_data(stackname)
      children = response.delete('children') || []
      result = { stackname => { stack_data: response } }
      children.each do |child|
        result.merge!(gather_master_data(child['name']))
      end
      result
    end
600264
def master_call(self, **kwargs):
        '''
        
        '''
        load = kwargs
        load['cmd'] = 'wheel'
        interface = self.opts['interface']
        if interface == '0.0.0.0':
            interface = '127.0.0.1'
        master_uri = 'tcp://{}:{}'.format(
            salt.utils.zeromq.ip_bracket(interface),
            six.text_type(self.opts['ret_port'])
        )
        channel = salt.transport.client.ReqChannel.factory(self.opts,
                                                           crypt='clear',
                                                           master_uri=master_uri,
                                                           usage='master_call')
        try:
            ret = channel.send(load)
        finally:
            channel.close()
        if isinstance(ret, collections.Mapping):
            if 'error' in ret:
                salt.utils.error.raise_error(**ret['error'])
        return ret
870517
def get_state_map(meta_graph, state_ops, unsupported_state_ops,
                  get_tensor_by_name):
  """"""
  state_map = {}
  for node in meta_graph.graph_def.node:
    if node.op in state_ops:
      tensor_name = node.name + ":0"
      tensor = get_tensor_by_name(tensor_name)
      num_outputs = len(tensor.op.outputs)
      if num_outputs != 1:
        raise ValueError("Stateful op %s has %d outputs, expected 1" %
                         (node.op, num_outputs))
      state_map[tensor_name] = tensor
    if node.op in unsupported_state_ops:
      raise ValueError("Unsupported stateful op: %s" % node.op)
  return state_map
418619
def get_network_link(self, mapsource):
        
        return kml_network_link(self.url_formatter.get_map_root_url(mapsource),
                                 name=mapsource.name, visible=False)
916171
def index(self):
        
        maps = self._get_maps_from_user(c.user)
        serialized_maps = []
        for m in maps:
            serialized_maps.append({
                "id": m.id,
                "name": m.name,
                "href": h.url_for(controller="mapfiles", action="show", id=m.id),
                'wmsproxyurl':h.url_for(controller='mapfiles', action='wms_proxy', id=m.id),
                'wmsurl': "%s?%s" %(config['mapserver_url'], urlencode({'map':os.path.join(config['mapfiles_dir'], m.filepath)}))
            })
        # prevent JSON Array Cross-site Exploits (XSRF/CSRF)
        return {'maps': serialized_maps}
144715
def _collect_node_profiles(self):
        """"""
        bm_client = self.app.client_manager.rdomanager_oscplugin.baremetal()

        # map of profile capability -> [node_uuid, ...]
        profile_map = collections.defaultdict(list)

        for node in bm_client.node.list(maintenance=False):
            node = bm_client.node.get(node.uuid)
            profiles = re.findall(r'profile:(.*?)(?:,|$)',
                                  node.properties.get('capabilities', ''))
            if not profiles:
                profile_map[None].append(node.uuid)
            for p in profiles:
                profile_map[p].append(node.uuid)

        return dict(profile_map)
536467
def master_ref(self):
        
        return ReferencesDataFrame(self._engine_dataframe.getMaster(),
                                   self._session, self._implicits)
        return self.ref('refs/heads/master')
1184755
public static Map<String, Object> collect() {
        Map<String, Object> infos = new TreeMap<String, Object>();

        systemInfo(infos);
        memInfo(infos);
        threadInfo(infos);
        gcInfo(infos);
        runtimeInfo(infos);

        return infos;
    }
613038
def _get_service_names(self):
        
        master_info = None
        connection_errors = []
        for sentinel in self._sentinel.sentinels:
            # Unfortunately, redis.sentinel.Sentinel does not support sentinel_masters, so we have to step
            # through all of its connections manually
            try:
                master_info = sentinel.sentinel_masters()
                break
            except (redis.ConnectionError, redis.TimeoutError) as e:
                connection_errors.append('Failed to connect to {} due to error: "{}".'.format(sentinel, e))
                continue
        if master_info is None:
            raise redis.ConnectionError(
                'Could not get master info from Sentinel\n{}:'.format('\n'.join(connection_errors))
            )
        return list(master_info.keys())
964624
def map_data(self, map_name):
    """"""
    with gfile.Open(os.path.join(self.data_dir, "Maps", map_name), "rb") as f:
      return f.read()
627180
def getRankMaps(self):
        

        rankMaps = []
        for preference in self.preferences:
            rankMaps.append(preference.getRankMap())
        return rankMaps
44989
def fetch_master_by_level
      masters = Keynote.fetch_master_slide_names

      {}.tap do |result|
        masters.each do |master|
          if master.match(/\Ah(?<level>[1-5])\z/)
            level = Integer(Regexp.last_match[:level])
            result[level] = master
          elsif master == 'cover'
            result[COVER_LEVEL] = 'cover'
          end
        end
      end
    end
87656
def networks(self):
        
        import ns1.rest.ipam
        return ns1.rest.ipam.Networks(self.config)