// IsGitInit returns the value of the git init flag or ture if none was set.
327880
func IsGitInit(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyGitInit).(bool)
	if !ok {
		return true
	}
	return bv
}
1250944
func (c *ConfigRepository) init() {
	c.initOnce.Do(func() {
		err := c.persistor.Load(c.data)
		if err != nil {
			c.onError(err)
		}
	})
}
706081
func (la LogicalAggregation) Init(ctx sessionctx.Context) *LogicalAggregation {
	la.baseLogicalPlan = newBaseLogicalPlan(ctx, TypeAgg, &la)
	return &la
}
708
func (t *StringTree) Init(flags byte) *StringTree {
	t.Tree.Init(stringCompare, flags)
	return t
}
1072566
func init() {
	for _, arg := range os.Args {
		if flag := strings.TrimLeft(arg, "-"); flag == TracingEnabledFlag {
			Enabled = true
		}
	}
}
61319
func Init(flags int) error {
	initted := int(C.Mix_Init(C.int(flags)))
	if initted&flags != flags {
		return sdl.GetError()
	}
	return nil
}
162541
func (h *Hist) Init(cfg Config) {
	if cfg.LowestDiscernible < 1 {
		panic("invalid cfg: LowestDiscernible must be >= 1")
	}
	if cfg.HighestTrackable < 2*cfg.LowestDiscernible {
		if cfg.AutoResize {
			cfg.HighestTrackable = 2 * cfg.LowestDiscernible
		} else {
			panic("invalid cfg: HighestTrackable must be >= 2*LowestDiscernible")
		}
	}
	if cfg.SigFigs < 0 || cfg.SigFigs > 5 {
		panic("invalid cfg: must have SigFigs ∈ [0,5]")
	}
	h.cfg = cfg

	unitMag := int32(math.Floor(math.Log2(float64(cfg.LowestDiscernible))))
	largestSingleUnitResolutionValue := 2 * math.Pow10(int(cfg.SigFigs))
	subCountMag := int32(math.Ceil(math.Log2(largestSingleUnitResolutionValue)))
	subHalfCountMag := int32(0)
	if subCountMag > 1 {
		subHalfCountMag = subCountMag - 1
	}
	subCount := int32(math.Pow(2, float64(subHalfCountMag+1)))
	subHalfCount := subCount / 2
	subMask := (int64(subCount) - 1) << uint64(unitMag)
	bucketCount := numBucketsToCoverVal(cfg.HighestTrackable, subCount, unitMag)
	countsLen := (bucketCount + 1) * subHalfCount

	h.b.counts = make([]int64, countsLen)
	h.b.subHalfCount = subHalfCount
	h.b.subHalfCountMag = subHalfCountMag
	h.b.subMask = subMask
	h.b.subCount = subCount
	h.b.bucketCount = bucketCount
	h.b.unitMag = unitMag
	h.b.leadZeroCountBase = 64 - unitMag - subHalfCountMag - 1
}
416119
func (c *commonFlags) Init(authOpts auth.Options) {
	c.defaultFlags.Init(&c.Flags)
	c.authFlags.Register(&c.Flags, authOpts)
	c.Flags.StringVar(&c.serverURL, "server", os.Getenv("SWARMING_SERVER"), "Server URL; required. Set $SWARMING_SERVER to set a default.")
	c.Flags.IntVar(&c.worker, "worker", 8, "Number of workers used to download isolated files.")
}
694271
func (t *Tree) Init(c CompareFunc, flags byte) *Tree {
	t.compare = c
	t.root = nil
	t.treeFlags = flags
	return t
}
877770
func (u *User) NewGitSig() *git.Signature {
	return &git.Signature{
		Name:  u.DisplayName(),
		Email: u.Email,
		When:  time.Now(),
	}
}
735272
func (p LogicalLock) Init(ctx sessionctx.Context) *LogicalLock {
	p.baseLogicalPlan = newBaseLogicalPlan(ctx, TypeLock, &p)
	return &p
}
1176881
func (s *Action) GitInit(ctx context.Context, c *cli.Context) error {
	store := c.String("store")
	un := c.String("username")
	ue := c.String("useremail")
	ctx = backend.WithRCSBackendString(ctx, c.String("rcs"))

	// default to git
	if !backend.HasRCSBackend(ctx) {
		ctx = backend.WithRCSBackend(ctx, backend.GitCLI)
	}

	if err := s.rcsInit(ctx, store, un, ue); err != nil {
		return ExitError(ctx, ExitGit, err, "failed to initialize git: %s", err)
	}
	return nil
}
799703
func (p LogicalUnionScan) Init(ctx sessionctx.Context) *LogicalUnionScan {
	p.baseLogicalPlan = newBaseLogicalPlan(ctx, TypeUnionScan, &p)
	return &p
}
899497
func Init() bool {
	initializer, exists := registeredInitializers[os.Args[0]]
	if exists {
		initializer()

		return true
	}
	return false
}
48156
func (t *ObjectTree) Init(flags byte) *ObjectTree {
	t.Tree.Init(objectCompare, flags)
	return t
}
875496
func init() {
	app.Action = bzzd
	app.Version = sv.ArchiveVersion(gitCommit)
	app.Copyright = "Copyright 2013-2016 The go-ethereum Authors"
	app.Commands = []cli.Command{
		{
			Action:             version,
			CustomHelpTemplate: helpTemplate,
			Name:               "version",
			Usage:              "Print version numbers",
			Description:        "The output of this command is supposed to be machine-readable",
		},
		{
			Action:             keys,
			CustomHelpTemplate: helpTemplate,
			Name:               "print-keys",
			Flags:              []cli.Flag{SwarmCompressedFlag},
			Usage:              "Print public key information",
			Description:        "The output of this command is supposed to be machine-readable",
		},
		// See upload.go
		upCommand,
		// See access.go
		accessCommand,
		// See feeds.go
		feedCommand,
		// See list.go
		listCommand,
		// See hash.go
		hashCommand,
		// See download.go
		downloadCommand,
		// See manifest.go
		manifestCommand,
		// See fs.go
		fsCommand,
		// See db.go
		dbCommand,
		// See config.go
		DumpConfigCommand,
		// hashesCommand
		hashesCommand,
	}

	// append a hidden help subcommand to all commands that have subcommands
	// if a help command was already defined above, that one will take precedence.
	addDefaultHelpSubcommands(app.Commands)

	sort.Sort(cli.CommandsByName(app.Commands))

	app.Flags = []cli.Flag{
		utils.IdentityFlag,
		utils.DataDirFlag,
		utils.BootnodesFlag,
		utils.KeyStoreDirFlag,
		utils.ListenPortFlag,
		utils.DiscoveryV5Flag,
		utils.NetrestrictFlag,
		utils.NodeKeyFileFlag,
		utils.NodeKeyHexFlag,
		utils.MaxPeersFlag,
		utils.NATFlag,
		utils.IPCDisabledFlag,
		utils.IPCPathFlag,
		utils.PasswordFileFlag,
		// bzzd-specific flags
		CorsStringFlag,
		EnsAPIFlag,
		SwarmTomlConfigPathFlag,
		SwarmSwapEnabledFlag,
		SwarmSwapAPIFlag,
		SwarmSyncDisabledFlag,
		SwarmSyncUpdateDelay,
		SwarmMaxStreamPeerServersFlag,
		SwarmLightNodeEnabled,
		SwarmDeliverySkipCheckFlag,
		SwarmListenAddrFlag,
		SwarmPortFlag,
		SwarmAccountFlag,
		SwarmNetworkIdFlag,
		ChequebookAddrFlag,
		// upload flags
		SwarmApiFlag,
		SwarmRecursiveFlag,
		SwarmWantManifestFlag,
		SwarmUploadDefaultPath,
		SwarmUpFromStdinFlag,
		SwarmUploadMimeType,
		// bootnode mode
		SwarmBootnodeModeFlag,
		// storage flags
		SwarmStorePath,
		SwarmStoreCapacity,
		SwarmStoreCacheCapacity,
		SwarmGlobalStoreAPIFlag,
	}
	rpcFlags := []cli.Flag{
		utils.WSEnabledFlag,
		utils.WSListenAddrFlag,
		utils.WSPortFlag,
		utils.WSApiFlag,
		utils.WSAllowedOriginsFlag,
	}
	app.Flags = append(app.Flags, rpcFlags...)
	app.Flags = append(app.Flags, debug.Flags...)
	app.Flags = append(app.Flags, swarmmetrics.Flags...)
	app.Flags = append(app.Flags, tracing.Flags...)
	app.Before = func(ctx *cli.Context) error {
		runtime.GOMAXPROCS(runtime.NumCPU())
		if err := debug.Setup(ctx, ""); err != nil {
			return err
		}
		swarmmetrics.Setup(ctx)
		tracing.Setup(ctx)
		return nil
	}
	app.After = func(ctx *cli.Context) error {
		debug.Exit()
		return nil
	}
}
1056853
func (client *Client) init() error {

	if client.shouldInit == false {
		C.SetPixImage(client.api, client.pixImage)
		return nil
	}

	var languages *C.char
	if len(client.Languages) != 0 {
		languages = C.CString(strings.Join(client.Languages, "+"))
	}
	defer C.free(unsafe.Pointer(languages))

	var configfile *C.char
	if _, err := os.Stat(client.ConfigFilePath); err == nil {
		configfile = C.CString(client.ConfigFilePath)
	}
	defer C.free(unsafe.Pointer(configfile))

	errbuf := [512]C.char{}
	res := C.Init(client.api, nil, languages, configfile, &errbuf[0])
	msg := C.GoString(&errbuf[0])

	if res != 0 {
		return fmt.Errorf("failed to initialize TessBaseAPI with code %d: %s", res, msg)
	}

	if err := client.setVariablesToInitializedAPI(); err != nil {
		return err
	}

	if client.pixImage == nil {
		return fmt.Errorf("PixImage is not set, use SetImage or SetImageFromBytes before Text or HOCRText")
	}

	C.SetPixImage(client.api, client.pixImage)

	client.shouldInit = false

	return nil
}