Installs the multicast discovery bundles and instantiates components
166649
def discovery_multicast(self):
        
        # Install the bundle
        self.context.install_bundle("pelix.remote.discovery.multicast").start()

        with use_waiting_list(self.context) as ipopo:
            # Instantiate the discovery
            ipopo.add(
                rs.FACTORY_DISCOVERY_MULTICAST, "pelix-discovery-multicast"
            )
474680
def setup(self):
        
        if not self.networks():
            super(FunctionLearning, self).setup()
            for net in self.networks():
                self.source(network=net)
226337
protected static ManagedUnicastService buildUnicastService(ClusterConfig config) {
    return new NettyUnicastService(config.getNodeConfig().getAddress(), config.getMessagingConfig());
  }
1178962
@Setup
    public void setup() {
        System.setProperty("io.netty.buffer.checkAccessible", checkAccessible);
        System.setProperty("io.netty.buffer.checkBounds", checkBounds);
        buffer = bufferType.newBuffer();
    }
651666
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException {
        ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId);
        ImportManager em = new ImportManager(myHostId, messenger, statsCollector);
        VoltDB.instance().getStatsAgent().registerStatsSource(
                StatsSelector.IMPORTER,
                myHostId,
                statsCollector);

        m_self = em;
        em.create(catalogContext);
    }
84564
def setup_link(self, interface, cidr):
        
        # clear old ipaddr in interface
        cmd = ['ip', 'addr', 'flush', 'dev', interface]
        agent_utils.execute(cmd, root=True)
        ip = IPNetwork(cidr)
        cmd = ['ip', 'addr', 'add', cidr, 'broadcast',
               str(ip.broadcast), 'dev', interface]
        stdcode, stdout = agent_utils.execute(cmd, root=True)
        if stdcode == 0:
            cmd = ['ip', 'link', 'set', 'dev', interface, 'up']
            stdcode, stdout = agent_utils.execute(cmd, root=True)
            if stdcode == 0:
                return agent_utils.make_response(code=stdcode)
        # execute failed.
        message = stdout.pop(0)
        return agent_utils.make_response(code=stdcode, message=message)
453121
def _install_wrappers(self):
        
        global action_loader__get
        action_loader__get = ansible_mitogen.loaders.action_loader.get
        ansible_mitogen.loaders.action_loader.get = wrap_action_loader__get

        global connection_loader__get
        connection_loader__get = ansible_mitogen.loaders.connection_loader.get
        ansible_mitogen.loaders.connection_loader.get = wrap_connection_loader__get

        global worker__run
        worker__run = ansible.executor.process.worker.WorkerProcess.run
        ansible.executor.process.worker.WorkerProcess.run = wrap_worker__run
959890
def _init_multicast_socket(self):
        
        self.debug("()")
        # Create a UDP socket
        self._multicast_socket = socket.socket(
            socket.AF_INET,
            socket.SOCK_DGRAM
        )

        # Allow reuse of addresses
        self._multicast_socket.setsockopt(
            socket.SOL_SOCKET,
            socket.SO_REUSEADDR,
            1
        )

        # Set multicast interface to local_ip
        self._multicast_socket.setsockopt(
            socket.IPPROTO_IP,
            socket.IP_MULTICAST_IF,
            socket.inet_aton(self._multicast_ip)
        )

        # Set multicast time-to-live
        # Should keep our multicast packets from escaping the local network
        self._multicast_socket.setsockopt(
            socket.IPPROTO_IP,
            socket.IP_MULTICAST_TTL,
            self._multicast_ttl
        )

        self._add_membership_multicast_socket()
        # Bind socket
        if platform.system().lower() == "darwin":
            self._multicast_socket.bind(("0.0.0.0", self._multicast_bind_port))
        else:
            self._multicast_socket.bind(
                (self._multicast_ip, self._multicast_bind_port)
            )
        self._listening.append(self._multicast_socket)
992054
@Override
    public void setupModule(SetupContext context) {
        FindSerializers serializers = new FindSerializers(jsonContext);
        locator.inject(serializers);
        locator.postConstruct(serializers);
        context.addSerializers(serializers);

        FindDeserializers deserializers = new FindDeserializers(jsonContext);
        locator.inject(deserializers);
        locator.postConstruct(deserializers);
        context.addDeserializers(deserializers);
    }
384370
def _setup_master(self):
        
        self.broker = mitogen.master.Broker(install_watcher=False)
        self.router = mitogen.master.Router(
            broker=self.broker,
            max_message_size=4096 * 1048576,
        )
        self._setup_responder(self.router.responder)
        mitogen.core.listen(self.broker, 'shutdown', self.on_broker_shutdown)
        mitogen.core.listen(self.broker, 'exit', self.on_broker_exit)
        self.listener = mitogen.unix.Listener(
            router=self.router,
            path=self.unix_listener_path,
            backlog=C.DEFAULT_FORKS,
        )
        self._enable_router_debug()
        self._enable_stack_dumps()
1105506
def create_bundle(self, bundleId, data=None):
        """"""
        headers={'content-type':'application/json'}
        url = self.__get_base_bundle_url() + "/" + bundleId
        if data is None:
            data = {}
            data['sourceLanguage'] = 'en'
            data['targetLanguages'] = []
            data['notes']=[]
            data['metadata']={}
            data['partner']=''
            data['segmentSeparatorPattern']=''
            data['noTranslationPattern']=''
        json_data = json.dumps(data)
        response = self.__perform_rest_call(requestURL=url, restType='PUT', body=json_data, headers=headers)
        return response
336149
@Setup
    public void setup() {
        baseClassDescription = TypePool.Default.ofSystemLoader().describe(baseClass.getName()).resolve();
    }
239583
@SuppressWarnings("unchecked")
	public synchronized <T> void install(Class<T> component) {
		Preconditions.checkArgument(component != null, 
				"Parameter 'component' must not be [" + component + "]");
		
		if (installed(component)) {
			logger.debug("Installation ignored: Component [" + component + "] has already been installed");
			return;
		}
		
		int modifiers = component.getModifiers();
		
		if (component.isInterface() || Modifier.isAbstract(modifiers) || !Modifier.isPublic(modifiers)) {
			logger.warn("Interface, abstract and non-public class cannot be installed: " 
					+ "Component [" + component + "]");
			return;
		}
		
		try {
			Descriptor<T> descriptor = new Descriptor<T>(component);
			List<Class<?>> classes = Collections.emptyList();
			
			if (Provider.class.isAssignableFrom(component)) {
				for (Type type : component.getGenericInterfaces()) {
					if ((type instanceof ParameterizedType) && ((ParameterizedType) type).getRawType().equals(Provider.class)) {
						Type t = ((ParameterizedType) type).getActualTypeArguments()[0];
						Class<?> clazz = (Class<?>) ((t instanceof ParameterizedType) ? ((ParameterizedType) t).getRawType() : t);
						classes = (List<Class<?>>) ClassUtils.getAllInterfaces(clazz);
						classes.addAll(ClassUtils.getAllSuperclasses(clazz));
						classes.add(clazz);
					}
				}
				
			} else {
				classes = (List<Class<?>>) ClassUtils.getAllInterfaces(component);
				classes.addAll(ClassUtils.getAllSuperclasses(component));
				classes.add(component);
			}
			
			classes.remove(Object.class);
			ListMultimap<Class<?>, Descriptor<?>> components = ArrayListMultimap.create();
			
			for (Class<?> type : classes) {
				components.put(type, descriptor);
			}
			
			ListMultimap<Annotation, Descriptor<?>> pointcuts = ArrayListMultimap.create();
			
			if (descriptor.aspect()) {
				for (Annotation pointcut : descriptor.pointcuts()) {
					pointcuts.put(pointcut, descriptor);
				}
			}
			
			Annotation scope = descriptor.scope();
			Class<? extends Annotation> s = (scope == null) ? Prototype.class : scope.annotationType();
			
			if (s.equals(Singleton.class) && ((Singleton) descriptor.scope()).eager()) {
				component(descriptor);
			}
			
			installed.add(component);
			this.components.putAll(components);
			this.pointcuts.putAll(pointcuts);
			logger.info("Component has been installed: Provider descriptor [" + descriptor + "]");
		} catch (Exception e) {
			logger.warn("Component cannot be installed: Provider type [" + component + "]", e);
			return;
		}
	}
938447
def _setup(self):
        """"""
        super(HyperVNeutronAgent, self)._setup()

        self._sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
        self._sec_groups_agent = HyperVSecurityAgent(self._context,
                                                     self._sg_plugin_rpc)
        self._vlan_driver = trunk_driver.HyperVTrunkDriver(self._context)
        if CONF.NVGRE.enable_support:
            self._consumers.append([h_constant.TUNNEL, topics.UPDATE])
            self._consumers.append([h_constant.LOOKUP, h_constant.UPDATE])
784102
public function setup()
    {
        $this->groupRoutes();

        foreach ($this->routes as $type => $routes) {
            foreach ($routes as $name => $route) {
                $newRoute = new Route($name, $route);
                if (!$newRoute->hasParam('hostname')) {
                    $newRoute->setParam('hostname', $this->resolveDefaultHostName());
                }

                $routeType = $this->resolveRouteType($type);
                $routeType->add($this->getRouter(), $newRoute);
            }
        }
    }
1268097
function() {
  setups = {}
  model.servers = []
  model.headers = []
  model.ui = _.clone(uidefaults)
  model.controls = _.clone(controldefaults)

  if (DEBUG) { console.log('discover started') }
  wampsession.publish('discover', [])
  setTimeout(function () {
    if (DEBUG) { console.log('discover ended') }
    model.servers = _.values(setups)
  }, 500)
}
89778
def _instantiate_app(self, target_cls, kwargs):
    """"""
    parse_context = ParseContext(kwargs['address'].spec_path, dict())
    bundleprops_factory = Bundle(parse_context)
    kwargs['bundles'] = [
      bundleprops_factory.create_bundle_props(bundle)
      for bundle in kwargs['bundles']
    ]

    return target_cls(build_graph=self, **kwargs)