// extractOperationOptionFromMethodDescriptor extracts the message of type
// swagger_options.Operation from a given proto method's descriptor.
1269
func extractOperationOptionFromMethodDescriptor(meth *pbdescriptor.MethodDescriptorProto) (*swagger_options.Operation, error) {
	if meth.Options == nil {
		return nil, nil
	}
	if !proto.HasExtension(meth.Options, swagger_options.E_Openapiv2Operation) {
		return nil, nil
	}
	ext, err := proto.GetExtension(meth.Options, swagger_options.E_Openapiv2Operation)
	if err != nil {
		return nil, err
	}
	opts, ok := ext.(*swagger_options.Operation)
	if !ok {
		return nil, fmt.Errorf("extension is %T; want an Operation", ext)
	}
	return opts, nil
}
1036496
func ExtractEnablePersonalization(opts ...interface{}) *opt.EnablePersonalizationOption {
	for _, o := range opts {
		if v, ok := o.(*opt.EnablePersonalizationOption); ok {
			return v
		}
	}
	return nil
}
599289
func GetOptionRequest(o dhcp6.Options) (OptionRequestOption, error) {
	v, err := o.GetOne(dhcp6.OptionORO)
	if err != nil {
		return nil, err
	}

	var oro OptionRequestOption
	err = oro.UnmarshalBinary(v)
	return oro, err
}
1227737
func (s *Option) SetOptionDescription(v string) *Option {
	s.OptionDescription = &v
	return s
}
638574
func decodeFindOptions(ctx context.Context, r *http.Request) (*platform.FindOptions, error) {
	opts := &platform.FindOptions{}
	qp := r.URL.Query()

	if offset := qp.Get("offset"); offset != "" {
		o, err := strconv.Atoi(offset)
		if err != nil {
			return nil, err
		}

		opts.Offset = o
	}

	if limit := qp.Get("limit"); limit != "" {
		l, err := strconv.Atoi(limit)
		if err != nil {
			return nil, err
		}

		if l < 1 || l > platform.MaxPageSize {
			return nil, errors.InvalidDataf("limit must be between 1 and %d", platform.MaxPageSize)
		}

		opts.Limit = l
	} else {
		opts.Limit = platform.DefaultPageSize
	}

	if sortBy := qp.Get("sortBy"); sortBy != "" {
		opts.SortBy = sortBy
	}

	if descending := qp.Get("descending"); descending != "" {
		desc, err := strconv.ParseBool(descending)
		if err != nil {
			return nil, err
		}

		opts.Descending = desc
	}

	return opts, nil
}
426248
func ExtractOptionalFilters(opts ...interface{}) *opt.OptionalFiltersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.OptionalFiltersOption); ok {
			return v
		}
	}
	return nil
}
115265
func ExtractDisableTypoToleranceOnWords(opts ...interface{}) *opt.DisableTypoToleranceOnWordsOption {
	for _, o := range opts {
		if v, ok := o.(*opt.DisableTypoToleranceOnWordsOption); ok {
			return v
		}
	}
	return nil
}
890458
func ExtractReferers(opts ...interface{}) *opt.ReferersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.ReferersOption); ok {
			return v
		}
	}
	return nil
}
1175108
func (p *Parser) parseOperator() (op selection.Operator, err error) {
	tok, lit := p.consume(KeyAndOperator)
	switch tok {
	// DoesNotExistToken shouldn't be here because it's a unary operator, not a binary operator
	case InToken:
		op = selection.In
	case EqualsToken:
		op = selection.Equals
	case DoubleEqualsToken:
		op = selection.DoubleEquals
	case GreaterThanToken:
		op = selection.GreaterThan
	case LessThanToken:
		op = selection.LessThan
	case NotInToken:
		op = selection.NotIn
	case NotEqualsToken:
		op = selection.NotEquals
	default:
		return "", fmt.Errorf("found '%s', expected: '=', '!=', '==', 'in', notin'", lit)
	}
	return op, nil
}
463861
func ExtractAutoGenerateObjectIDIfNotExist(opts ...interface{}) *opt.AutoGenerateObjectIDIfNotExistOption {
	for _, o := range opts {
		if v, ok := o.(*opt.AutoGenerateObjectIDIfNotExistOption); ok {
			return v
		}
	}
	return nil
}
381644
func ExtractAttributesToRetrieve(opts ...interface{}) *opt.AttributesToRetrieveOption {
	for _, o := range opts {
		if v, ok := o.(*opt.AttributesToRetrieveOption); ok {
			return v
		}
	}
	return nil
}
680817
func GetOptions(resolvConf []byte) []string {
	options := []string{}
	for _, line := range getLines(resolvConf, []byte("#")) {
		match := optionsRegexp.FindSubmatch(line)
		if match == nil {
			continue
		}
		options = strings.Fields(string(match[1]))
	}
	return options
}
1031917
func parseOperationType(parser *Parser) (string, error) {
	operationToken, err := expect(parser, lexer.NAME)
	if err != nil {
		return "", err
	}
	switch operationToken.Value {
	case ast.OperationTypeQuery:
		return operationToken.Value, nil
	case ast.OperationTypeMutation:
		return operationToken.Value, nil
	case ast.OperationTypeSubscription:
		return operationToken.Value, nil
	default:
		return "", unexpected(parser, operationToken)
	}
}
135448
func (c *Menu) GetOptionFromIndex(idx int) *MenuOption {
	if idx >= 0 && idx < len(c.options) {
		return &c.options[idx]
	}
	return nil
}
724614
func ConvertStringToOperator(in string) (configs.Operator, error) {
	if op, ok := operators[in]; ok == true {
		return op, nil
	}
	return 0, fmt.Errorf("string %s is not a valid operator for seccomp", in)
}
757358
func BlobDescriptorServiceFactory(factory distribution.BlobDescriptorServiceFactory) RegistryOption {
	return func(registry *registry) error {
		registry.blobDescriptorServiceFactory = factory
		return nil
	}
}
633144
func (c ProvisionUiClient) ChooseProvisioningMethod(ctx context.Context, __arg ChooseProvisioningMethodArg) (res ProvisionMethod, err error) {
	err = c.Cli.Call(ctx, "keybase.1.provisionUi.chooseProvisioningMethod", []interface{}{__arg}, &res)
	return
}