// capture wraps the expression in a capturing group.
766386
func capture(res ...*regexp.Regexp) *regexp.Regexp {
	return match(`(` + expression(res...).String() + `)`)
}
931015
func Wrap(e error) error {
	if e == nil {
		return nil
	}
	return errors.Wrap(e, 1)
}
1046688
func (m *Mux) Match(ctx *c.Context) bool {
	for _, matcher := range m.Matchers {
		if !matcher(ctx) {
			return false
		}
	}
	return true
}
1291009
func (se *StdExtractor) Extract(e *Entry) error {
	if se.rxFields == nil {
		se.rxFields = regexp.MustCompile(fieldsRegex)
	}
	matches := se.rxFields.FindAllSubmatch(e.Message, -1)
	if matches == nil {
		return nil
	}

	var key, value []byte
	captures := make(map[string]interface{})

	// Look for positions with: fmt.Printf("%#v \n", rxFields.SubexpNames())
	// Will find positions []string{"", "key", "", "", "value", "", "quoted", ""}
	//                                    1               4            6

	for _, match := range matches {
		// First group, simple key-value detected
		if len(match[1]) > 0 && len(match[4]) > 0 {
			key, value = match[1], match[4]
		}

		// Second group, quoted value detected
		if len(match[1]) > 0 && len(match[6]) > 0 {
			key, value = match[1], match[6]
			value = value[1 : len(value)-1] // remove quotes, first and last character
		}

		captures[string(key)] = string(value)
	}

	if captures != nil {
		// Eliminate key=value from text and trim from the right
		e.Message = bytes.TrimRight(se.rxFields.ReplaceAll(e.Message, nil), " \n")
		for k, v := range captures {
			e.Fields[k] = v
		}
	}

	return nil
}
1001290
func (c Client) Capture(id string, params *stripe.CaptureParams) (*stripe.Charge, error) {
	path := stripe.FormatURLPath("/v1/charges/%s/capture", id)
	charge := &stripe.Charge{}
	err := c.B.Call(http.MethodPost, path, c.Key, params, charge)
	return charge, err
}
839266
func Compile(s string) (expr Expression, err error) {
	if s == "0" {
		return constValue{value: 0}, nil
	}
	if !strings.Contains(s, "?") {
		s += "?1:0"
	}
	return compileExpression(s)
}
272029
func (a *assertion) Match(obtained, regex string, msgs ...string) bool {
	matches, err := a.IsMatching(obtained, regex)
	if err != nil {
		return a.failer.Fail(Match, obtained, regex, "can't compile regex: "+err.Error())
	}
	if !matches {
		return a.failer.Fail(Match, obtained, regex, msgs...)
	}
	return true
}
670584
func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error {
	jst.ctx["output"] = output
	jst.ctx["gasUsed"] = gasUsed
	jst.ctx["time"] = t.String()

	if err != nil {
		jst.ctx["error"] = err.Error()
	}
	return nil
}
1149657
func (s *callStack) capture(freeVars ast.Identifiers) bindingFrame {
	env := make(bindingFrame)
	for _, fv := range freeVars {
		env[fv] = s.lookUpVarOrPanic(fv)
	}
	return env
}
514915
func (we *WorkflowExecutor) CaptureScriptResult() error {
	if we.Template.Script == nil {
		return nil
	}
	log.Infof("Capturing script output")
	mainContainerID, err := we.GetMainContainerID()
	if err != nil {
		return err
	}
	reader, err := we.RuntimeExecutor.GetOutputStream(mainContainerID, false)
	if err != nil {
		return err
	}
	defer func() { _ = reader.Close() }()
	bytes, err := ioutil.ReadAll(reader)
	if err != nil {
		return errors.InternalWrapError(err)
	}
	out := string(bytes)
	// Trims off a single newline for user convenience
	outputLen := len(out)
	if outputLen > 0 && out[outputLen-1] == '\n' {
		out = out[0 : outputLen-1]
	}
	we.Template.Outputs.Result = &out
	return nil
}
79297
func Extract(ctx context.Context) Tags {
	t, ok := ctx.Value(ctxMarkerKey).(Tags)
	if !ok {
		return NoopTags
	}

	return t
}
1064636
func (ffl *FFLexer) CaptureField(start FFTok) ([]byte, error) {
	return ffl.scanField(start, true)
}
1238309
func (c *Capture) Runes() []rune {
	return c.text[c.Index : c.Index+c.Length]
}
510289
func Recover(ctx context.Context, v interface{}) (e error) {
	switch err := v.(type) {
	case nil:
		e = nil
	case error:
		e = New(ctx, err, 0)
	default:
		e = New(ctx, fmt.Errorf("%v", err), 0)
	}

	return e
}
1096280
func Capture(clientName, streamName string, spec *SampleSpec) (*Stream, error) {
	return NewStream("", clientName, STREAM_RECORD, "", streamName, spec, nil, nil)
}
149452
func (r *runner) capture(capnum, start, end int) {
	if end < start {
		T := end
		end = start
		start = T
	}

	r.crawl(capnum)
	r.runmatch.addMatch(capnum, start, end-start)
}
1253656
func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
	if h, ok := a.t.(tHelper); ok {
		h.Helper()
	}
	return Regexp(a.t, rx, str, msgAndArgs...)
}