// init initializes the handler with a tracer
425447
func (h *Handler) init(cfg config.Configuration) error {
	if cfg.Sampler != nil && cfg.Sampler.SamplingServerURL == "" {
		cfg.Sampler.SamplingServerURL = h.samplingServerURL
	}
	if cfg.Reporter != nil && cfg.Reporter.LocalAgentHostPort == "" {
		cfg.Reporter.LocalAgentHostPort = h.agentHostPort
	}
	tracer, _, err := cfg.New(common.DefaultTracerServiceName)
	if err != nil {
		return err
	}
	h.tracers[cfg.Sampler.Type] = tracer
	return nil
}
674627
func (mrr *MultiRoutineRunner) init() {
	for i := 0; i < mrr.num; i++ {
		go mrr.runner()
	}
}
315398
func (c *listCommand) Init(args []string) (err error) {
	return cmd.CheckEmpty(args)
}
61668
func (r *Runtime) Init(name string) {
	uv4, err := uuid.NewV4()
	if err != nil {
		log.Println(err.Error())
	}
	r.id = uv4.String()
	r.done = make(chan struct{})
	r.ready = make(chan struct{})
	r.handlers = make(map[string]protocolHandler)
	r.handlers["runtime.getruntime"] = func(ws *websocket.Conn, payload interface{}) {
		sendJSON(ws, runtimeMessage{
			Protocol: "runtime",
			Command:  "runtime",
			Payload: runtimeInfo{Type: name,
				Version: "0.4",
				Capabilities: []string{"protocol:runtime",
					"protocol:graph",
					"protocol:component",
					"protocol:network",
					"component:getsource"},
				Id: r.id,
			},
		})
	}
	r.handlers["graph.clear"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(clearGraph)
		r.graphs[msg.Id] = new(Graph)
		r.graphs[msg.Id].InitGraphState()
		if msg.Main {
			r.mainId = msg.Id
			r.main = r.graphs[msg.Id]
		}
		if _, exists := ComponentRegistry[msg.Id]; !exists {
			Register(msg.Id, func() interface{} {
				net := new(Graph)
				net.InitGraphState()
				return net
			})
		}
		Annotate(msg.Id, ComponentInfo{
			Description: msg.Description,
			Icon:        msg.Icon,
		})
		UpdateComponentInfo(msg.Id)
		entry, _ := ComponentRegistry[msg.Id]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["graph.addnode"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(addNode)
		r.graphs[msg.Graph].AddNew(msg.Component, msg.Id)
	}
	r.handlers["graph.removenode"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(removeNode)
		r.graphs[msg.Graph].Remove(msg.Id)
	}
	r.handlers["graph.renamenode"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(renameNode)
		r.graphs[msg.Graph].Rename(msg.From, msg.To)
	}
	r.handlers["graph.changenode"] = func(ws *websocket.Conn, payload interface{}) {
		// Currently unsupported
	}
	r.handlers["graph.addedge"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(addEdge)
		r.graphs[msg.Graph].Connect(msg.Src.Node, msg.Src.Port, msg.Tgt.Node, msg.Tgt.Port)
	}
	r.handlers["graph.removedge"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(removeEdge)
		r.graphs[msg.Graph].Disconnect(msg.Src.Node, msg.Src.Port, msg.Tgt.Node, msg.Tgt.Port)
	}
	r.handlers["graph.changeedge"] = func(ws *websocket.Conn, payload interface{}) {
		// Currently unsupported
	}
	r.handlers["graph.addinitial"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(addInitial)
		r.graphs[msg.Graph].AddIIP(msg.Src.Data, msg.Tgt.Node, msg.Tgt.Port)
	}
	r.handlers["graph.removeinitial"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(removeInitial)
		r.graphs[msg.Graph].RemoveIIP(msg.Tgt.Node, msg.Tgt.Port)
	}
	r.handlers["graph.addinport"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(addPort)
		r.graphs[msg.Graph].MapInPort(msg.Public, msg.Node, msg.Port)
		UpdateComponentInfo(msg.Graph)
		entry, _ := ComponentRegistry[msg.Graph]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["graph.removeinport"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(removePort)
		r.graphs[msg.Graph].UnsetInPort(msg.Public)
		r.graphs[msg.Graph].UnmapInPort(msg.Public)
		UpdateComponentInfo(msg.Graph)
		entry, _ := ComponentRegistry[msg.Graph]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["graph.renameinport"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(renamePort)
		r.graphs[msg.Graph].RenameInPort(msg.From, msg.To)
		UpdateComponentInfo(msg.Graph)
		entry, _ := ComponentRegistry[msg.Graph]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["graph.addoutport"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(addPort)
		r.graphs[msg.Graph].MapOutPort(msg.Public, msg.Node, msg.Port)
		UpdateComponentInfo(msg.Graph)
		entry, _ := ComponentRegistry[msg.Graph]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["graph.removeoutport"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(removePort)
		r.graphs[msg.Graph].UnsetOutPort(msg.Public)
		r.graphs[msg.Graph].UnmapOutPort(msg.Public)
		UpdateComponentInfo(msg.Graph)
		entry, _ := ComponentRegistry[msg.Graph]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["graph.renameoutport"] = func(ws *websocket.Conn, payload interface{}) {
		msg := payload.(renamePort)
		r.graphs[msg.Graph].RenameOutPort(msg.From, msg.To)
		UpdateComponentInfo(msg.Graph)
		entry, _ := ComponentRegistry[msg.Graph]
		sendJSON(ws, componentMessage{
			Protocol: "component",
			Command:  "component",
			Payload:  entry.Info,
		})
	}
	r.handlers["component.list"] = func(ws *websocket.Conn, payload interface{}) {
		for key, entry := range ComponentRegistry {
			if len(entry.Info.InPorts) == 0 && len(entry.Info.OutPorts) == 0 {
				// Need to obtain ports annotation for the first time
				UpdateComponentInfo(key)
			}
			sendJSON(ws, componentMessage{
				Protocol: "component",
				Command:  "component",
				Payload:  entry.Info,
			})
		}
	}
}
331312
func (c *Context) init(ctx *fasthttp.RequestCtx) {
	c.RequestCtx = ctx
	c.data = nil
	c.index = -1
	c.Serialize = Serialize
}
1074999
func (m *Module) Init(c *service.Config) {
	c.Setup = func() error {
		m.BaseAuthenticator = m
		return nil
	}
}
399909
func (mr *MockRPCServerMockRecorder) Init() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockRPCServer)(nil).Init))
}
300410
func (l *ByteIntervalList) Init() *ByteIntervalList {
	l.root.next = &l.root
	l.root.prev = &l.root
	l.len = 0
	return l
}
218557
func (b *sqsBroker) Init(opts ...broker.Option) error {
	for _, o := range opts {
		o(&b.options)
	}

	return nil
}
202216
func (s *Server) Init() {
	s.mux = http.NewServeMux()

	// Register local handlers
	s.RegisterHandler(s, diagPaths2Func)
}
1331909
func (c *UpdateCommand) Init(args []string) error {
	var err error
	c.Name, c.CIDRs, err = ParseNameAndCIDRs(args, false)
	return errors.Trace(err)
}
369617
func (mr *MockServiceDiscoveryMockRecorder) Init() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockServiceDiscovery)(nil).Init))
}
1278970
func (h *byNameHandler) Init() error {
	for _, handler := range h.handlers {
		if err := handler.Handler.Init(); err != nil {
			return err
		}
	}
	return nil
}
978867
func (f *FastHTTPServer) Init(init *revel.EngineInit) {
	f.MaxMultipartSize = int64(revel.Config.IntDefault("server.request.max.multipart.filesize", 32)) << 20 /* 32 MB */
	fastHttpContextStack = utils.NewStackLock(revel.Config.IntDefault("server.context.stack", 100),
		revel.Config.IntDefault("server.context.maxstack", 200),
		func() interface{} { return NewFastHttpContext(f) })
	fastHttpMultipartFormStack = utils.NewStackLock(revel.Config.IntDefault("server.form.stack", 100),
		revel.Config.IntDefault("server.form.maxstack", 200),
		func() interface{} { return &FastHttpMultipartForm{} })

	requestHandler := func(ctx *fasthttp.RequestCtx) {
		f.RequestHandler(ctx)
	}
	// Adds the mux list
	f.HttpMuxList = init.HTTPMuxList
	sort.Sort(f.HttpMuxList)
	f.HasAppMux = len(f.HttpMuxList) > 0

	f.signalChan = make(chan os.Signal)

	f.ServerInit = init
	f.Server = &fasthttp.Server{
		ReadTimeout:  time.Duration(revel.Config.IntDefault("http.timeout.read", 0)) * time.Second,
		WriteTimeout: time.Duration(revel.Config.IntDefault("http.timeout.write", 0)) * time.Second,
		Handler:      requestHandler,
	}

}
1209915
func (c *showCommand) Init(args []string) error {
	if len(args) == 0 {
		return errors.New("missing ID")
	}
	id, args := args[0], args[1:]
	if err := cmd.CheckEmpty(args); err != nil {
		return errors.Trace(err)
	}
	c.ID = id
	return nil
}
803890
func (s *Scanner) init() (err error) {
	if s.b != nil {
		return nil
	}
	s.b, err = ioutil.ReadAll(s.r)
	return err
}
1237718
func (pTypeDef *Polyline) Init() *Polyline {
	if pTypeDef.Points == nil {
		pTypeDef.Points = make([]*Point, 0)
	}
	return pTypeDef
}