// NewFunctionInternal is similar to NewFunction, but do not returns error, should only be used internally.
774511
func NewFunctionInternal(ctx sessionctx.Context, funcName string, retType *types.FieldType, args ...Expression) Expression {
	expr, err := NewFunction(ctx, funcName, retType, args...)
	terror.Log(err)
	return expr
}
668778
func newRuleImpl(impl starlark.Callable, defaults *starlark.Dict) (*ruleImpl, error) {
	pairs := defaults.Items()
	for _, pair := range pairs {
		k, v := pair[0], pair[1]
		if _, ok := k.(starlark.String); !ok {
			return nil, fmt.Errorf("lucicfg.rule: keys in \"defaults\" must be strings")
		}
		if !isNamedStruct(v, "lucicfg.var") {
			return nil, fmt.Errorf("lucicfg.rule: values in \"defaults\" must be lucicfg.var")
		}
	}
	return &ruleImpl{
		Callable: impl,
		defaults: starlarkstruct.FromKeywords(starlark.String("lucicfg.rule.defaults"), pairs),
	}, nil
}
541492
func (bf *BlockFilterer) foundInternal(scopedIndex waddrmgr.ScopedIndex) {
	if _, ok := bf.FoundInternal[scopedIndex.Scope]; !ok {
		bf.FoundInternal[scopedIndex.Scope] = make(map[uint32]struct{})
	}
	bf.FoundInternal[scopedIndex.Scope][scopedIndex.Index] = struct{}{}
}
920939
func New(f interface{}) plugins.Handler {
	ft := reflect.TypeOf(f)
	if ft.NumIn() == 0 {
		return untypedHandler{reflect.ValueOf(f)}
	}
	return typedHandler{reflect.ValueOf(f), ft.In(0)}
}
1140695
func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection {
	return pushStack(s, winnowFunction(s, f, false))
}
965555
func NewFnType(ts ...Type) *FunctionType {
	if len(ts) < 2 {
		panic("Expected at least 2 input types")
	}

	retVal := borrowFnType()
	retVal.a = ts[0]

	if len(ts) > 2 {
		retVal.b = NewFnType(ts[1:]...)
	} else {
		retVal.b = ts[1]
	}
	return retVal
}
846385
func New(ie interface{}, a ...interface{}) error {
	if ie == nil {
		return nil
	}
	switch err := ie.(type) {
	case *Error:
		return err
	case string:
		return newError(err, 2, a...)
	case error:
		return newError(err, 2, a...)
	default:
		panic("invalid error type")
	}
}
159716
func NewErrorFrom(kind ErrorKind, inner error) *Error {
	return &Error{
		kind:  kind,
		inner: inner,
	}
}
1225519
func NewNexter(opts ...NexterOption) *Nexter {
	var id uint64
	n := &Nexter{
		id: &id,
	}
	for _, opt := range opts {
		opt(n)
	}
	return n
}
1317537
func (plugin *flexVolumePlugin) newUnmounterInternal(volName string, podUID types.UID, mounter mount.Interface, runner exec.Interface) (volume.Unmounter, error) {
	var metricsProvider volume.MetricsProvider
	if plugin.capabilities.SupportsMetrics {
		metricsProvider = volume.NewMetricsStatFS(plugin.host.GetPodVolumeDir(
			podUID, utilstrings.EscapeQualifiedName(plugin.driverName), volName))
	} else {
		metricsProvider = &volume.MetricsNil{}
	}

	return &flexVolumeUnmounter{
		flexVolume: &flexVolume{
			driverName:      plugin.driverName,
			execPath:        plugin.getExecutable(),
			mounter:         mounter,
			plugin:          plugin,
			podUID:          podUID,
			volName:         volName,
			MetricsProvider: metricsProvider,
		},
		runner: runner,
	}, nil
}
997594
func interpolationFuncList() ast.Function {
	return ast.Function{
		ArgTypes:     []ast.Type{},
		ReturnType:   ast.TypeList,
		Variadic:     true,
		VariadicType: ast.TypeAny,
		Callback: func(args []interface{}) (interface{}, error) {
			var outputList []ast.Variable

			for i, val := range args {
				switch v := val.(type) {
				case string:
					outputList = append(outputList, ast.Variable{Type: ast.TypeString, Value: v})
				case []ast.Variable:
					outputList = append(outputList, ast.Variable{Type: ast.TypeList, Value: v})
				case map[string]ast.Variable:
					outputList = append(outputList, ast.Variable{Type: ast.TypeMap, Value: v})
				default:
					return nil, fmt.Errorf("unexpected type %T for argument %d in list", v, i)
				}
			}

			// we don't support heterogeneous types, so make sure all types match the first
			if len(outputList) > 0 {
				firstType := outputList[0].Type
				for i, v := range outputList[1:] {
					if v.Type != firstType {
						return nil, fmt.Errorf("unexpected type %s for argument %d in list", v.Type, i+1)
					}
				}
			}

			return outputList, nil
		},
	}
}
1347142
func (runtime *_runtime) newBoundFunction(target *_object, this Value, argumentList []Value) *_object {
	self := runtime.newBoundFunctionObject(target, this, argumentList)
	self.prototype = runtime.global.FunctionPrototype
	prototype := runtime.newObject()
	self.defineProperty("prototype", toValue_object(prototype), 0100, false)
	prototype.defineProperty("constructor", toValue_object(self), 0100, false)
	return self
}
657752
func newLFunctionL(proto *FunctionProto, env *LTable, nupvalue int) *LFunction {
	return &LFunction{
		IsG: false,
		Env: env,

		Proto:     proto,
		GFunction: nil,
		Upvalues:  make([]*Upvalue, nupvalue),
	}
}
256669
func (d *domainClient) CallFunctionOn(ctx context.Context, args *CallFunctionOnArgs) (reply *CallFunctionOnReply, err error) {
	reply = new(CallFunctionOnReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Runtime.callFunctionOn", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Runtime.callFunctionOn", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Runtime", Op: "CallFunctionOn", Err: err}
	}
	return
}
1365036
func newFunctionNode(name, prefix string, args []node) node {
	return &functionNode{nodeType: nodeFunction, Prefix: prefix, FuncName: name, Args: args}
}
508044
func WithInit(fn func(*cli.Context) error) Option {
	return func(o *Options) {
		o.Init = fn
	}
}
235271
func IsInternal(file string) bool {
	// fs cannot import config, so we hard code .stfolder here (config.DefaultMarkerName)
	internals := []string{".stfolder", ".stignore", ".stversions"}
	for _, internal := range internals {
		if file == internal {
			return true
		}
		if IsParent(file, internal) {
			return true
		}
	}
	return false
}