// doLocalSymbolize adds symbol and line number information to all locations
// in a profile. mode enables some options to control
// symbolization.
177392
func doLocalSymbolize(prof *profile.Profile, fast, force bool, obj plugin.ObjTool, ui plugin.UI) error {
	if fast {
		if bu, ok := obj.(*binutils.Binutils); ok {
			bu.SetFastSymbolization(true)
		}
	}

	mt, err := newMapping(prof, obj, ui, force)
	if err != nil {
		return err
	}
	defer mt.close()

	functions := make(map[profile.Function]*profile.Function)
	for _, l := range mt.prof.Location {
		m := l.Mapping
		segment := mt.segments[m]
		if segment == nil {
			// Nothing to do.
			continue
		}

		stack, err := segment.SourceLine(l.Address)
		if err != nil || len(stack) == 0 {
			// No answers from addr2line.
			continue
		}

		l.Line = make([]profile.Line, len(stack))
		l.IsFolded = false
		for i, frame := range stack {
			if frame.Func != "" {
				m.HasFunctions = true
			}
			if frame.File != "" {
				m.HasFilenames = true
			}
			if frame.Line != 0 {
				m.HasLineNumbers = true
			}
			f := &profile.Function{
				Name:       frame.Func,
				SystemName: frame.Func,
				Filename:   frame.File,
			}
			if fp := functions[*f]; fp != nil {
				f = fp
			} else {
				functions[*f] = f
				f.ID = uint64(len(mt.prof.Function)) + 1
				mt.prof.Function = append(mt.prof.Function, f)
			}
			l.Line[i] = profile.Line{
				Function: f,
				Line:     int64(frame.Line),
			}
		}

		if len(stack) > 0 {
			m.HasInlineFrames = true
		}
	}

	return nil
}
63419
func (s *EndpointDemographic) SetLocale(v string) *EndpointDemographic {
	s.Locale = &v
	return s
}
798910
func (s *DescribeEventTypesInput) SetLocale(v string) *DescribeEventTypesInput {
	s.Locale = &v
	return s
}
1125040
func (s *CatAllocationService) Local(local bool) *CatAllocationService {
	s.local = &local
	return s
}
252571
func (s *DescribeEventDetailsInput) SetLocale(v string) *DescribeEventDetailsInput {
	s.Locale = &v
	return s
}
184476
func loadLocalsHcl(list *ast.ObjectList) ([]*Local, error) {

	result := make([]*Local, 0, len(list.Items))

	for _, block := range list.Items {
		if len(block.Keys) > 0 {
			return nil, fmt.Errorf(
				"locals block at %s should not have label %q",
				block.Pos(), block.Keys[0].Token.Value(),
			)
		}

		blockObj, ok := block.Val.(*ast.ObjectType)
		if !ok {
			return nil, fmt.Errorf("locals value at %s should be a block", block.Val.Pos())
		}

		// blockObj now contains directly our local decls
		for _, item := range blockObj.List.Items {
			if len(item.Keys) != 1 {
				return nil, fmt.Errorf("local declaration at %s may not be a block", item.Val.Pos())
			}

			// By the time we get here there can only be one item left, but
			// we'll decode into a map anyway because it's a convenient way
			// to extract both the key and the value robustly.
			kv := map[string]interface{}{}
			hcl.DecodeObject(&kv, item)
			for k, v := range kv {
				rawConfig, err := NewRawConfig(map[string]interface{}{
					"value": v,
				})

				if err != nil {
					return nil, fmt.Errorf(
						"error parsing local value %q at %s: %s",
						k, item.Val.Pos(), err,
					)
				}

				result = append(result, &Local{
					Name:      k,
					RawConfig: rawConfig,
				})
			}
		}
	}

	return result, nil
}
825975
func InitLocal(level string) {
	l, err := logrus.ParseLevel(level)
	if err != nil {
		fmt.Fprintf(os.Stderr, "failed to setup logging: %v\n", err)
		os.Exit(1)
	}
	logger.Level = l
}
463515
func NewLocalPositionNedSystemGlobalOffset(TIME_BOOT_MS uint32, X float32, Y float32, Z float32, ROLL float32, PITCH float32, YAW float32) *LocalPositionNedSystemGlobalOffset {
	m := LocalPositionNedSystemGlobalOffset{}
	m.TIME_BOOT_MS = TIME_BOOT_MS
	m.X = X
	m.Y = Y
	m.Z = Z
	m.ROLL = ROLL
	m.PITCH = PITCH
	m.YAW = YAW
	return &m
}
244422
func LoadLocalIssuedLicense(ctx context.Context, filename string) (*model.IssuedLicense, error) {
	lclient, err := getClient()
	if err != nil {
		return nil, err
	}
	return doLoadLocalIssuedLicense(ctx, filename, lclient)
}
483290
func (l *Localizer) MustLocalize(lc *LocalizeConfig) string {
	localized, err := l.Localize(lc)
	if err != nil {
		panic(err)
	}
	return localized
}
1168398
func DoLocalLimit(reader io.Reader, writer io.Writer, n int, offset int, stats *pb.InstructionStat) error {

	return util.ProcessRow(reader, nil, func(row *util.Row) error {
		stats.InputCounter++

		if offset > 0 {
			offset--
		} else {
			if n > 0 {
				row.WriteTo(writer)
				stats.OutputCounter++
			}
			n--
		}

		return nil
	})

}
35987
func (s *Ssml) SetLocale(v string) *Ssml {
	s.Locale = &v
	return s
}
817902
func LoadLocaleText(l string) ([]byte, error) {
	lText, err := ioutil.ReadFile("./lang/" + l + ".json")
	if err != nil {
		return nil, errors.New("not able to read the lang file:" + err.Error())
	}

	return lText, nil
}
758715
func SimplifiedLocale(lang string) string {
	// en_US/en_US.UTF-8/zh_CN/zh_TW/el_GR@euro/...
	if idx := strings.Index(lang, ":"); idx != -1 {
		lang = lang[:idx]
	}
	if idx := strings.Index(lang, "@"); idx != -1 {
		lang = lang[:idx]
	}
	if idx := strings.Index(lang, "."); idx != -1 {
		lang = lang[:idx]
	}
	return strings.TrimSpace(lang)
}
1216634
func (e *executor) mapperLocal(ctx context.Context, shards []uint64, mapFn mapFunc, reduceFn reduceFunc) (interface{}, error) {
	span, ctx := tracing.StartSpanFromContext(ctx, "Executor.mapperLocal")
	defer span.Finish()

	ch := make(chan mapResponse, len(shards))

	for _, shard := range shards {
		go func(shard uint64) {
			result, err := mapFn(shard)

			// Return response to the channel.
			select {
			case <-ctx.Done():
			case ch <- mapResponse{result: result, err: err}:
			}
		}(shard)
	}

	// Reduce results
	var maxShard int
	var result interface{}
	for {
		select {
		case <-ctx.Done():
			return nil, ctx.Err()
		case resp := <-ch:
			if resp.err != nil {
				return nil, resp.err
			}
			result = reduceFn(result, resp.result)
			maxShard++
		}

		// Exit once all shards are processed.
		if maxShard == len(shards) {
			return result, nil
		}
	}
}
1328833
func isLocalImport(path string) bool {
	return path == "." || path == ".." || strings.HasPrefix(path, "./") || strings.HasPrefix(path, "../")
}
861394
func resolveSymbolicLink(path, scope string) (string, error) {
	info, err := os.Lstat(path)
	if err != nil {
		return "", err
	}
	if info.Mode()&os.ModeSymlink != os.ModeSymlink {
		return path, nil
	}
	if scope == "" {
		scope = "/"
	}
	return symlink.FollowSymlinkInScope(path, scope)
}