// InitBanner loads the banner and prints it to output
// All errors are ignored, the application will not
// print the banner in case of error.
974537
func InitBanner(out io.Writer, in io.Reader) {
	if in == nil {
		beeLogger.Log.Fatal("The input is nil")
	}

	banner, err := ioutil.ReadAll(in)
	if err != nil {
		beeLogger.Log.Fatalf("Error while trying to read the banner: %s", err)
	}

	show(out, string(banner))
}
798223
func InitLogger(handle io.Writer, prefix string) *log.Logger {
	return log.New(handle, strings.Join([]string{prefix, ": "}, ""), log.Ldate|log.Ltime|log.Lshortfile)
}
270688
func init() {
	zeroArg = make([]reflect.Value, 0)
	zeroArgInterf = make([]interface{}, 0)
	trueInterf = true
	falseInterf = false
	nilInterf = nil
}
1320095
func init() {
	validation.Rules.Add(
		"regex:projects/.*",
		"${appid}.cfg",
		func(ctx *validation.Context, configSet, path string, content []byte) error {
			cfg := &notifypb.ProjectConfig{}
			if err := proto.UnmarshalText(string(content), cfg); err != nil {
				ctx.Errorf("invalid ProjectConfig proto message: %s", err)
			} else {
				validateProjectConfig(ctx, cfg)
			}
			return nil
		})

	validation.Rules.Add(
		"regex:projects/.*",
		`regex:${appid}/email-templates/[^/]+\.template`,
		validateEmailTemplateFile)
}
946968
func (c *Client) GetBanners(ctx context.Context, ch chan *HostData) error {
	resp, err := c.startStreaming(ctx, bannersPath)
	if err != nil {
		return err
	}

	go c.handleResponseStream(resp, ch)

	return nil
}
441097
func (d *DenyExec) ValidateInitialization() error {
	if d.client == nil {
		return fmt.Errorf("missing client")
	}
	return nil
}
1080843
func InitLogger() logger.Logger {
	lvl := logger.ERROR
	if ll := os.Getenv("LOG_LEVEL"); ll != "" {
		lvl = logger.ParseLevel(ll)
	}

	return logger.New(log.New(os.Stdout, "", 0), lvl)
}
1280772
func (c *Client) GetBannersByASN(ctx context.Context, asn []string, ch chan *HostData) error {
	path := fmt.Sprintf(bannersASNPath, strings.Join(asn, ","))
	resp, err := c.startStreaming(ctx, path)
	if err != nil {
		return err
	}

	go c.handleResponseStream(resp, ch)

	return nil
}
517640
func Init(prefix string) {
	// Needs to happen in servenv.OnRun() instead of init because it requires flag parsing and logging
	servenv.OnRun(func() {
		if *openTsdbURI == "" {
			return
		}

		backend := &openTSDBBackend{
			prefix: prefix,
			// If you want to global service values like host, service name, git revision, etc,
			// this is the place to do it.
			commonTags: map[string]string{},
		}

		stats.RegisterPushBackend("opentsdb", backend)

		http.HandleFunc("/debug/opentsdb", func(w http.ResponseWriter, r *http.Request) {
			w.Header().Set("Content-Type", "application/json; charset=utf-8")
			dataPoints := (*backend).getDataPoints()
			sort.Sort(byMetric(dataPoints))

			if b, err := json.MarshalIndent(dataPoints, "", "  "); err != nil {
				w.Write([]byte(err.Error()))
			} else {
				w.Write(b)
			}
		})
	})
}
1030143
func (b *Build) Banners() (result []Logo) {
	var os, ver string
	// A swarming dimension may have multiple values.  Eg.
	// Linux, Ubuntu, Ubuntu-14.04.  We want the most specific one.
	// The most specific one always comes last.
	for _, dim := range b.GetInfra().GetSwarming().GetBotDimensions() {
		if dim.Key != "os" {
			continue
		}
		os = dim.Value
		parts := strings.SplitN(os, "-", 2)
		if len(parts) == 2 {
			os = parts[0]
			ver = parts[1]
		}
	}
	var base LogoBase
	switch os {
	case "Ubuntu":
		base = Ubuntu
	case "Windows":
		base = Windows
	case "Mac":
		base = OSX
	case "Android":
		base = Android
	default:
		return
	}
	return []Logo{{
		LogoBase: base,
		Subtitle: ver,
		Count:    1,
	}}
}
958091
func (s *server) initBinary() error {
	s.network.Handle("InsertTriples", s.handleInsertTriples)
	s.network.Handle("QueryRequest", s.handleQueryRequest)

	return nil
}
703496
func (rs *Ruleset) LoadReader(r io.Reader) error {
	m := map[string]string{}
	err := json.NewDecoder(r).Decode(&m)
	if err != nil {
		return fmt.Errorf("could not decode inflection JSON from reader: %s", err)
	}
	for s, p := range m {
		defaultRuleset.AddIrregular(s, p)
	}
	return nil
}
544097
func (l *JSONLogger) InitLogger() error {
	if len(l.config.HostURI) == 0 {
		return fmt.Errorf("A HostURI must be set")
	}
	hostURL, err := url.Parse(l.config.HostURI)
	if err != nil {
		return fmt.Errorf("Invalid HostURI: %v", err)
	}
	if !strings.Contains(hostURL.Host, ":") {
		return fmt.Errorf("A port must be provided")
	}
	l.hostURL = hostURL

	l.unprefixedMap = make(map[string]bool)
	for _, fieldName := range l.config.UnprefixedFields {
		l.unprefixedMap[fieldName] = true
	}

	if err := l.connect(); err != nil {
		if !l.config.AllowDisconnectedInit {
			return err
		}

		// Reconnect in background
		l.performReconnect()
	}

	l.isInitialized = true
	return nil
}
1199351
func (h *TermsHashPerFieldImpl) initReader(reader *ByteSliceReader, termId, stream int) {
	assert(stream < h.streamCount)
	intStart := h.postingsArray.intStarts[termId]
	ints := h.intPool.Buffers[intStart>>util.INT_BLOCK_SHIFT]
	upto := intStart & util.INT_BLOCK_MASK
	reader.init(h.bytePool,
		h.postingsArray.byteStarts[termId]+stream*util.FIRST_LEVEL_SIZE,
		ints[upto+stream])
}
453748
func init() {
	log.Out = os.Stdout
	if debug {
		log.Level = logger.DebugLevel
	}
}
389976
func (entity *BaseEntity) InitBaseEntityParser() {
	entity.On = true
	entity.Visible = true
	entity.Init(map[int]core.TypeParser{
		5:  core.NewStringTypeParserToVar(&entity.Handle),
		6:  core.NewStringTypeParserToVar(&entity.LineTypeName),
		8:  core.NewStringTypeParserToVar(&entity.LayerName),
		48: core.NewFloatTypeParserToVar(&entity.LineTypeScale),
		60: core.NewIntTypeParser(func(value int) {
			entity.Visible = value == 0
		}),
		62: core.NewIntTypeParser(func(value int) {
			if value < 0 {
				entity.On = false
				value = -value
			}
			entity.Color = value
		}),
		67: core.NewIntTypeParser(func(value int) {
			entity.Space = Space(value)
		}),
		284: core.NewIntTypeParser(func(value int) {
			entity.ShadowMode = ShadowMode(value)
		}),
		330: core.NewStringTypeParserToVar(&entity.Owner),
		370: core.NewIntTypeParserToVar(&entity.LineWeight),
		410: core.NewStringTypeParserToVar(&entity.LayoutTabName),

		420: core.NewIntTypeParser(func(value int) {
			entity.TrueColor = core.TrueColor(value)
		}),
		430: core.NewStringTypeParserToVar(&entity.ColorName),
		440: core.NewIntTypeParserToVar(&entity.Transparency),
	})
}
948516
func init() {
	// Anything unrecognized gets redirected to the status page.
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		http.Redirect(w, r, "/debug/status", http.StatusFound)
	})
}