// CallFindOne call find one method
17634
func (res *Resource) CallFindOne(result interface{}, metaValues *MetaValues, context *qor.Context) error {
	return res.FindOneHandler(result, metaValues, context)
}
1317542
func callEffectDone(channel C.int, udata unsafe.Pointer) {
	index := int(uintptr(udata))
	allEffectDone[index](int(channel))
}
575507
func formatCall(format string, c stack.Call) string {
	return fmt.Sprintf(format, c)
}
523369
func FindMethodForService(s *pb.ServiceDescriptorProto, name string) int {
	for i, x := range s.GetMethod() {
		if x.GetName() == name {
			return i
		}
	}
	return -1
}
194751
func mainFind(ctx *cli.Context) error {
	// Additional command specific theme customization.
	console.SetColor("Find", color.New(color.FgGreen, color.Bold))
	console.SetColor("FindExecErr", color.New(color.FgRed, color.Italic, color.Bold))

	// Parse encryption keys per command.
	encKeyDB, err := getEncKeys(ctx)
	fatalIf(err, "Unable to parse encryption keys.")

	checkFindSyntax(ctx, encKeyDB)

	args := ctx.Args()
	if !args.Present() {
		args = []string{"./"} // Not args present default to present directory.
	} else if args.Get(0) == "." {
		args[0] = "./" // If the arg is '.' treat it as './'.
	}

	clnt, err := newClient(args[0])
	fatalIf(err.Trace(args...), "Unable to initialize `"+args[0]+"`.")

	var olderThan, newerThan string

	if ctx.String("older-than") != "" {
		olderThan = ctx.String("older-than")
	}
	if ctx.String("newer-than") != "" {
		newerThan = ctx.String("newer-than")
	}

	// Use 'e' to indicate Go error, this is a convention followed in `mc`. For probe.Error we call it
	// 'err' and regular Go error is called as 'e'.
	var e error
	var largerSize, smallerSize uint64

	if ctx.String("larger") != "" {
		largerSize, e = humanize.ParseBytes(ctx.String("larger"))
		fatalIf(probe.NewError(e).Trace(ctx.String("larger")), "Unable to parse input bytes.")
	}

	if ctx.String("smaller") != "" {
		smallerSize, e = humanize.ParseBytes(ctx.String("smaller"))
		fatalIf(probe.NewError(e).Trace(ctx.String("smaller")), "Unable to parse input bytes.")
	}

	targetAlias, _, hostCfg, err := expandAlias(args[0])
	fatalIf(err.Trace(args[0]), "Unable to expand alias.")

	var targetFullURL string
	if hostCfg != nil {
		targetFullURL = hostCfg.URL
	}

	return doFind(&findContext{
		Context:       ctx,
		maxDepth:      ctx.Uint("maxdepth"),
		execCmd:       ctx.String("exec"),
		printFmt:      ctx.String("print"),
		namePattern:   ctx.String("name"),
		pathPattern:   ctx.String("path"),
		regexPattern:  ctx.String("regex"),
		ignorePattern: ctx.String("ignore"),
		olderThan:     olderThan,
		newerThan:     newerThan,
		largerSize:    largerSize,
		smallerSize:   smallerSize,
		watch:         ctx.Bool("watch"),
		targetAlias:   targetAlias,
		targetURL:     args[0],
		targetFullURL: targetFullURL,
		clnt:          clnt,
	})
}
363785
func NewFind(ctx *middleware.Context, handler FindHandler) *Find {
	return &Find{Context: ctx, Handler: handler}
}
791717
func CallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
	return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params)
}
765598
func (v *evalVisitor) isHelperCall(node *ast.Expression) bool {
	if helperName := node.HelperName(); helperName != "" {
		return v.findHelper(helperName) != zero
	}
	return false
}
605901
func callValidate(obj, validateMethod reflect.Value) field.ErrorList {
	args := []reflect.Value{obj}
	ret := validateMethod.Call(args)[0].Interface()

	// This convolution is necessary because nil interfaces won't convert
	// to errors.
	if ret == nil {
		return nil
	}
	return ret.(field.ErrorList)
}
296559
func Find(arr interface{}, predicate interface{}) interface{} {
	if !IsIteratee(arr) {
		panic("First parameter must be an iteratee")
	}

	if !IsFunction(predicate, 1, 1) {
		panic("Second argument must be function")
	}

	funcValue := reflect.ValueOf(predicate)

	funcType := funcValue.Type()

	if funcType.Out(0).Kind() != reflect.Bool {
		panic("Return argument should be a boolean")
	}

	arrValue := reflect.ValueOf(arr)

	for i := 0; i < arrValue.Len(); i++ {
		elem := arrValue.Index(i)

		result := funcValue.Call([]reflect.Value{elem})[0].Interface().(bool)

		if result {
			return elem.Interface()
		}
	}

	return nil
}
78796
func (r *Router) Find(method string, path string, c *Context) HandlerFunc {
	_logger.debug("===Find")
	_logger.debug("method:" + method)
	_logger.debug("path:" + path)
	if path[0] == '/' && len(path) > 1 {
		path = path[1:]
	}

	currentNode := r.tree.rootNode
	if path == "/" {
		return currentNode.findHandler(method)
	}

	pathArray := strings.Split(path, "/")
	count := len(pathArray)

	pathParams := make(map[int][]Param)
	var paramsNum int

	for index, element := range pathArray {
		// find static node first
		childNode := currentNode.findChildByName(element)

		if childNode == nil {
			// looking for parameter node
			childNode = currentNode.findChildByKind(pkind)

			if childNode != nil {
				_logger.debugf("parameter node: %s", element)
				var newParams []Param
				for _, pName := range childNode.pNames {
					param := Param{Key: pName, Value: element}
					newParams = append(newParams, param)
				}
				pathParams[paramsNum] = newParams
				paramsNum++
			}
		}

		if childNode == nil {
			// looking for match any node
			childNode = currentNode.findChildByKind(akind)

			if childNode != nil {
				_logger.debugf("match node: %s", element)
				start := 0
				for i := 0; i < index; i++ {
					start += 1 + len(pathArray[i])
				}
				_logger.debugf("start: %d", start)
				_logger.debugf("pname count: %d", len(childNode.pNames))
				var newParams []Param
				for _, pName := range childNode.pNames {
					val := path[start:]
					_logger.debugf("val: %s", val)
					param := Param{Key: pName, Value: val}
					newParams = append(newParams, param)
				}
				pathParams[paramsNum] = newParams
				paramsNum++

				index = count - 1
			}
		}

		if childNode == nil {
			//return notFoundHandler
			return nil
		}

		// last node in the path
		if count == index+1 {
			myHandler := childNode.findHandler(method)
			if myHandler == nil {
				//return notFoundHandler
				_logger.debug("handler was not found")
				return nil
			}

			// var newParams []Param
			// for _, pName := range childNode.pNames {
			// 	param := Param{Key: pName, Value: element}
			// 	newParams = append(newParams, param)
			// }
			// pathParams[paramsNum] = newParams
			// paramsNum++

			paramsNum = 0
			//println("params_count:", len(pathParams))
			_logger.debug("lastNode_params_count:", len(childNode.params))
			for _, validParam := range childNode.params {
				for _, p := range pathParams[paramsNum] {
					if validParam == p.Key {
						_logger.debug("matched: " + validParam + "," + p.Value)
						c.params = append(c.params, p)
					}
				}
				paramsNum++
			}

			return myHandler
		}

		currentNode = childNode
	}
	//return notFoundHandler
	return nil
}
1061824
func (q *Query) endCall() *Call {
	elem := q.callStack[len(q.callStack)-1]
	q.callStack[len(q.callStack)-1] = nil
	q.callStack = q.callStack[:len(q.callStack)-1]
	return elem.call
}
56820
func (f *StringForwarder) invokeCallback(callback func(string), msg string) {
	f.mu.Unlock()
	defer f.mu.Lock()
	callback(msg)
}
855284
func findHelper(name string) reflect.Value {
	helpersMutex.RLock()
	defer helpersMutex.RUnlock()

	return helpers[name]
}
441601
func (d *Context) CallMethod(nargs int) {
	C.duk_call_method(d.duk_context, C.duk_idx_t(nargs))
}
534627
func (mr *MockEmbeddedMockRecorder) EmbeddedMethod() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EmbeddedMethod", reflect.TypeOf((*MockEmbedded)(nil).EmbeddedMethod))
}
452497
func HelpCallback() {
	msg := fmt.Sprintf(usageStr, os.Args[0])
	fmt.Printf("%s\n", msg)
	os.Exit(0)
}