// Implement the "ExecerContext" interface
766739
func (cn *conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) {
	list := make([]driver.Value, len(args))
	for i, nv := range args {
		list[i] = nv.Value
	}

	if ctx.Done() != nil {
		closed := watchCancel(ctx, cn.cancel)
		defer close(closed)
	}

	return cn.Exec(query, list)
}
592069
func AddMessageToContext(ctx context.Context, msg *slack.MessageEvent) context.Context {
	return context.WithValue(ctx, MESSAGE_CONTEXT, msg)
}
153593
func (mod *NotificationBee) execAction(text string, urgency uint32) {
	note := gosxnotifier.NewNotification("Beehive")
	note.Title = text
	note.Push()
}
1007310
func (stmt *OCI8Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {
	list := make([]namedValue, len(args))
	for i, nv := range args {
		list[i] = toNamedValue(nv)
	}
	return stmt.exec(ctx, list)
}
328267
func (me *TxDatabase) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
	me.Trace("EXEC", query, args...)
	return me.Tx.ExecContext(ctx, query, args...)
}
157862
func (e *EventsInstance) GoExecute(eventName string, next func(bool), sessions ...interface{}) {
	if e.listeners == nil {
		next(true)
		return
	}
	c := make(chan int)
	n := 0
	e.lock.RLock()
	defer e.lock.RUnlock()
	if l, ok := e.listeners[eventName]; ok {
		if len(l) > 0 {
			for _, h := range l {
				n++
				//h 的原型为 func(interface{}, func(bool))
				go h(func(_ bool) {
					c <- 1
				}, sessions...)
			}
		}
	}
	for n > 0 {
		i := <-c
		if i == 1 {
			n--
		}
	}
	if next == nil {
		return
	}
	next(true)
}
1358018
func (c *conn) ExecTx(fn func(tx *trans) error) error {
	if c.flavor.executeTx != nil {
		return c.flavor.executeTx(c.db, func(sqlTx *sql.Tx) error {
			return fn(&trans{sqlTx, c})
		})
	}

	sqlTx, err := c.db.Begin()
	if err != nil {
		return err
	}
	if err := fn(&trans{sqlTx, c}); err != nil {
		sqlTx.Rollback()
		return err
	}
	return sqlTx.Commit()
}
145048
func InitOSContext() func() {
	runtime.LockOSThread()
	if err := ns.SetNamespace(); err != nil {
		logrus.Error(err)
	}
	return runtime.UnlockOSThread
}
1147544
func (mod *NotificationBee) execAction(text string, urgency uint32) {
	conn, err := dbus.SessionBus()
	if err != nil {
		panic(err)
	}

	notifier := conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
	call := notifier.Call("org.freedesktop.Notifications.Notify", 0, "", uint32(0),
		"", "Beehive", text, []string{},
		map[string]dbus.Variant{"urgency": dbus.MakeVariant(urgency)}, int32(5000))

	if call.Err != nil {
		mod.Logln("(" + string(urgency) + ") Failed to print message: " + text)
	}
}
450598
func (intr *Interpreter) execBuiltin() *starlark.Builtin {
	return starlark.NewBuiltin("exec", func(th *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
		var module starlark.String
		if err := starlark.UnpackArgs("exec", args, kwargs, "module", &module); err != nil {
			return nil, err
		}
		mod := module.GoString()

		// Only threads started via 'exec' (or equivalently ExecModule) can exec
		// other scripts. Modules that are loaded via load(...), or custom callbacks
		// from native code aren't allowed to call exec, since exec's impurity may
		// lead to unexpected results.
		if GetThreadKind(th) != ThreadExecing {
			return nil, fmt.Errorf("exec %s: forbidden in this context, only exec'ed scripts can exec other scripts", mod)
		}

		// See also th.Load in runModule.
		key, err := makeModuleKey(mod, th)
		if err != nil {
			return nil, err
		}
		dict, err := intr.ExecModule(Context(th), key.pkg, key.path)
		if err != nil {
			// Starlark stringifies errors using Error(). For EvalError, Error()
			// string is just a root cause, it does not include the backtrace where
			// the execution failed. Preserve it explicitly by sticking the backtrace
			// into the error message.
			//
			// Note that returning 'err' as is will preserve the backtrace inside
			// the execed module, but we'll lose the backtrace of the 'exec' call
			// itself, since EvalError object will just bubble to the top of the Go
			// call stack unmodified.
			if evalErr, ok := err.(*starlark.EvalError); ok {
				return nil, fmt.Errorf("exec %s failed: %s", mod, evalErr.Backtrace())
			}
			return nil, fmt.Errorf("cannot exec %s: %s", mod, err)
		}

		return starlarkstruct.FromStringDict(starlark.String("execed"), dict), nil
	})
}
254301
func ProbeExecution(argv, env []string, cwd string) *Execution {
	if env == nil {
		env = os.Environ()
	}
	if cwd == "" {
		cwd, _ = os.Getwd()
	}
	return probeExecutionImpl(argv, env, cwd)
}
1059291
func (sim *simra) NewTextTexture(text string, fontsize float64, fontcolor color.RGBA, rect image.Rectangle) *Texture {
	simlog.FuncIn()

	gl := sim.gl
	tex := gl.MakeTextureByText(text, fontsize, fontcolor, rect.Rectangle)
	t := &Texture{
		simra:   sim,
		texture: gl.NewTexture(tex),
	}
	runtime.SetFinalizer(t, (*Texture).release)

	simlog.FuncOut()
	return t
}
79912
func (f *LogFile) execEntry(e *LogEntry) {
	switch e.Flag {
	case LogEntryMeasurementTombstoneFlag:
		f.execDeleteMeasurementEntry(e)
	case LogEntryTagKeyTombstoneFlag:
		f.execDeleteTagKeyEntry(e)
	case LogEntryTagValueTombstoneFlag:
		f.execDeleteTagValueEntry(e)
	default:
		f.execSeriesEntry(e)
	}
}
24614
func WrapEchoContext(ctx echo.Context) context.Context {
	requestId := ctx.Get("request_id")
	return context.WithValue(ctx.Context(), "request_id", requestId)
}
1373767
func (client *Client) HOCRText() (out string, err error) {
	if err = client.init(); err != nil {
		return
	}
	out = C.GoString(C.HOCRText(client.api))
	return
}
393267
func NamedExecStrictContext(
	ctx context.Context,
	tx dbtypes.Named,
	query string,
	arg interface{},
) (result sql.Result, err error) {
	stmt, err := tx.PrepareNamed(query)
	if err != nil {
		return result, ErrorPrepareNamed.New(err)
	}
	if result, err = stmt.ExecContext(ctx, arg); err != nil {
		return result, wrapStrictError(err)
	}
	num, err := result.RowsAffected()
	if err != nil {
		return result, wrapStrictError(err)
	}
	if num < 1 {
		return result, ErrorNoRowAffected.New(nil)
	}
	return result, nil
}
672931
func (s *HistoryEvent) SetExecutionSucceededEventDetails(v *ExecutionSucceededEventDetails) *HistoryEvent {
	s.ExecutionSucceededEventDetails = v
	return s
}