// OrgOptions takes an org content byte slice and a renderer to use
976631
func OrgOptions(input []byte, renderer blackfriday.Renderer) []byte {
	// in the case that we need to render something in isEmpty but there isn't a new line char
	input = append(input, '\n')
	var output bytes.Buffer

	p := NewParser(renderer)

	scanner := bufio.NewScanner(bytes.NewReader(input))
	// used to capture code blocks
	marker := ""
	syntax := ""
	listType := ""
	inParagraph := false
	inList := false
	inTable := false
	inFixedWidthArea := false
	inFootNote := false
	curFootNoteId := ""
	var tmpBlock bytes.Buffer

	for scanner.Scan() {
		data := scanner.Bytes()

		if !isEmpty(data) && isComment(data) || IsKeyword(data) {
			switch {
			case inList:
				if tmpBlock.Len() > 0 {
					p.generateList(&output, tmpBlock.Bytes(), listType)
				}
				inList = false
				listType = ""
				tmpBlock.Reset()
			case inTable:
				if tmpBlock.Len() > 0 {
					p.generateTable(&output, tmpBlock.Bytes())
				}
				inTable = false
				tmpBlock.Reset()
			case inParagraph:
				if tmpBlock.Len() > 0 {
					p.generateParagraph(&output, tmpBlock.Bytes()[:len(tmpBlock.Bytes())-1])
				}
				inParagraph = false
				tmpBlock.Reset()
			case inFixedWidthArea:
				if tmpBlock.Len() > 0 {
					tmpBlock.WriteString("</pre>\n")
					output.Write(tmpBlock.Bytes())
				}
				inFixedWidthArea = false
				tmpBlock.Reset()
			case inFootNote:
				inFootNote = false
				curFootNoteId = ""
			}

		}

		switch {
		case isEmpty(data):
			switch {
			case inList:
				if tmpBlock.Len() > 0 {
					p.generateList(&output, tmpBlock.Bytes(), listType)
				}
				inList = false
				listType = ""
				tmpBlock.Reset()
			case inTable:
				if tmpBlock.Len() > 0 {
					p.generateTable(&output, tmpBlock.Bytes())
				}
				inTable = false
				tmpBlock.Reset()
			case inParagraph:
				if tmpBlock.Len() > 0 {
					p.generateParagraph(&output, tmpBlock.Bytes()[:len(tmpBlock.Bytes())-1])
				}
				inParagraph = false
				tmpBlock.Reset()
			case inFixedWidthArea:
				if tmpBlock.Len() > 0 {
					tmpBlock.WriteString("</pre>\n")
					output.Write(tmpBlock.Bytes())
				}
				inFixedWidthArea = false
				tmpBlock.Reset()
			case inFootNote:
				inFootNote = false
				curFootNoteId = ""
			case marker != "":
				tmpBlock.WriteByte('\n')
			default:
				continue
			}
		case isPropertyDrawer(data) || marker == "PROPERTIES":
			if marker == "" {
				marker = "PROPERTIES"
			}
			if bytes.Equal(data, []byte(":END:")) {
				marker = ""
			}
			continue
		case isBlock(data) || marker != "":
			matches := reBlock.FindSubmatch(data)
			if len(matches) > 0 {
				if string(matches[1]) == "END" {
					switch marker {
					case "QUOTE":
						var tmpBuf bytes.Buffer
						p.inline(&tmpBuf, tmpBlock.Bytes())
						p.r.BlockQuote(&output, tmpBuf.Bytes())
					case "CENTER":
						var tmpBuf bytes.Buffer
						output.WriteString("<center>\n")
						p.inline(&tmpBuf, tmpBlock.Bytes())
						output.Write(tmpBuf.Bytes())
						output.WriteString("</center>\n")
					default:
						tmpBlock.WriteByte('\n')
						p.r.BlockCode(&output, tmpBlock.Bytes(), syntax)
					}
					marker = ""
					tmpBlock.Reset()
					continue
				}

			}
			if marker != "" {
				if marker != "SRC" && marker != "EXAMPLE" {
					var tmpBuf bytes.Buffer
					tmpBuf.Write([]byte("<p>\n"))
					p.inline(&tmpBuf, data)
					tmpBuf.WriteByte('\n')
					tmpBuf.Write([]byte("</p>\n"))
					tmpBlock.Write(tmpBuf.Bytes())

				} else {
					if !(tmpBlock.Len() == 0 && (marker == "SRC" || marker == "EXAMPLE")) {
						tmpBlock.WriteByte('\n')
					}
					tmpBlock.Write(data)
				}

			} else {
				marker = string(matches[2])
				syntax = string(matches[3])
			}
		case isFootnoteDef(data) || inFootNote:
			if isFootnoteDef(data) {
				matches := reFootnoteDef.FindSubmatch(data)
				for i := range p.notes {
					if p.notes[i].id == string(matches[1]) {
						p.notes[i].def = string(matches[2])
						inFootNote = true
						curFootNoteId = string(matches[1])
					}
				}
			} else if inFootNote {
				for i := range p.notes {
					if p.notes[i].id == curFootNoteId {
						p.notes[i].def += " "
						p.notes[i].def += string(data)
					}
				}
			}
		case isTable(data):
			if inTable != true {
				inTable = true
			}
			tmpBlock.Write(data)
			tmpBlock.WriteByte('\n')
		case IsKeyword(data):
			continue
		case isComment(data):
			p.generateComment(&output, data)
		case isHeadline(data):
			p.generateHeadline(&output, data)
		case isDefinitionList(data):
			if inList != true {
				listType = "dl"
				inList = true
			}
			var work bytes.Buffer
			flags := blackfriday.LIST_TYPE_DEFINITION
			matches := reDefinitionList.FindSubmatch(data)
			flags |= blackfriday.LIST_TYPE_TERM
			p.inline(&work, matches[1])
			p.r.ListItem(&tmpBlock, work.Bytes(), flags)
			work.Reset()
			flags &= ^blackfriday.LIST_TYPE_TERM
			p.inline(&work, matches[2])
			p.r.ListItem(&tmpBlock, work.Bytes(), flags)
		case isUnorderedList(data):
			if inList != true {
				listType = "ul"
				inList = true
			}
			matches := reUnorderedList.FindSubmatch(data)
			var work bytes.Buffer
			p.inline(&work, matches[2])
			p.r.ListItem(&tmpBlock, work.Bytes(), 0)
		case isOrderedList(data):
			if inList != true {
				listType = "ol"
				inList = true
			}
			matches := reOrderedList.FindSubmatch(data)
			var work bytes.Buffer
			tmpBlock.WriteString("<li")
			if len(matches[2]) > 0 {
				tmpBlock.WriteString(" value=\"")
				tmpBlock.Write(matches[2])
				tmpBlock.WriteString("\"")
				matches[3] = matches[3][1:]
			}
			p.inline(&work, matches[3])
			tmpBlock.WriteString(">")
			tmpBlock.Write(work.Bytes())
			tmpBlock.WriteString("</li>\n")
		case isHorizontalRule(data):
			p.r.HRule(&output)
		case isExampleLine(data):
			if inParagraph == true {
				if len(tmpBlock.Bytes()) > 0 {
					p.generateParagraph(&output, tmpBlock.Bytes()[:len(tmpBlock.Bytes())-1])
					inParagraph = false
				}
				tmpBlock.Reset()
			}
			if inFixedWidthArea != true {
				tmpBlock.WriteString("<pre class=\"example\">\n")
				inFixedWidthArea = true
			}
			matches := reExampleLine.FindSubmatch(data)
			tmpBlock.Write(matches[1])
			tmpBlock.WriteString("\n")
			break
		default:
			if inParagraph == false {
				inParagraph = true
				if inFixedWidthArea == true {
					if tmpBlock.Len() > 0 {
						tmpBlock.WriteString("</pre>")
						output.Write(tmpBlock.Bytes())
					}
					inFixedWidthArea = false
					tmpBlock.Reset()
				}
			}
			tmpBlock.Write(data)
			tmpBlock.WriteByte('\n')
		}
	}

	if len(tmpBlock.Bytes()) > 0 {
		if inParagraph == true {
			p.generateParagraph(&output, tmpBlock.Bytes()[:len(tmpBlock.Bytes())-1])
		} else if inFixedWidthArea == true {
			tmpBlock.WriteString("</pre>\n")
			output.Write(tmpBlock.Bytes())
		}
	}

	// Writing footnote def. list
	if len(p.notes) > 0 {
		flags := blackfriday.LIST_ITEM_BEGINNING_OF_LIST
		p.r.Footnotes(&output, func() bool {
			for i := range p.notes {
				p.r.FootnoteItem(&output, []byte(p.notes[i].id), []byte(p.notes[i].def), flags)
			}
			return true
		})
	}

	return output.Bytes()
}
1180686
func (s *Server) Options(w http.ResponseWriter, req *http.Request) {
	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
	w.WriteHeader(http.StatusOK)
}
509467
func (g *Group) OPTIONS(path string, h HandlerFunc, m ...MiddlewareFunc) *Route {
	return g.Add(http.MethodOptions, path, h, m...)
}
122359
func (s *AccessPoliciesStatus) SetOptions(v string) *AccessPoliciesStatus {
	s.Options = &v
	return s
}
1078470
func (s *CertificateDetail) SetOptions(v *CertificateOptions) *CertificateDetail {
	s.Options = v
	return s
}
641240
func (s *DomainEntry) SetOptions(v map[string]*string) *DomainEntry {
	s.Options = v
	return s
}
1134195
func (s *RequestCertificateInput) SetOptions(v *CertificateOptions) *RequestCertificateInput {
	s.Options = v
	return s
}
131882
func fillOptions(options *Options) *Options {
	if options == nil {
		options = &Options{}
	}

	if options.Encoder == nil {
		options.Encoder = DefaultEncode
	}
	if options.Decoder == nil {
		options.Decoder = DefaultDecode
	}

	return options
}
1009543
func (cfg *BuildCfg) options(ctx context.Context) (fx.Option, *cfg.Config) {
	err := cfg.fillDefaults()
	if err != nil {
		return fx.Error(err), nil
	}

	repoOption := fx.Provide(func(lc fx.Lifecycle) repo.Repo {
		lc.Append(fx.Hook{
			OnStop: func(ctx context.Context) error {
				return cfg.Repo.Close()
			},
		})

		return cfg.Repo
	})

	metricsCtx := fx.Provide(func() helpers.MetricsCtx {
		return helpers.MetricsCtx(ctx)
	})

	hostOption := fx.Provide(func() libp2p.HostOption {
		return cfg.Host
	})

	routingOption := fx.Provide(func() libp2p.RoutingOption {
		return cfg.Routing
	})

	conf, err := cfg.Repo.Config()
	if err != nil {
		return fx.Error(err), nil
	}

	return fx.Options(
		repoOption,
		hostOption,
		routingOption,
		metricsCtx,
	), conf
}
441895
func (b *DefaultsOptionsBuilder) BuildOptions(o interface{}) error {
	options := o.(*kops.ClusterSpec)

	if options.ClusterDNSDomain == "" {
		options.ClusterDNSDomain = "cluster.local"
	}

	return nil
}
489607
func (c *Command) GroupOptions(names ...string) OptionGroup {
	var group OptionGroup
	for _, n := range names {
		o := c.Option(n)
		if o == nil {
			panicCommand("Option not found: %s", n)
		}
		group.Options = append(group.Options, o)
	}
	return group
}
778531
func (b *OptionsBuilder) BuildOptions(o interface{}) error {
	cs, ok := o.(*kops.ClusterSpec)
	if !ok {
		return errors.New("expected a ClusterSpec object")
	}

	if cs.NodeAuthorization != nil {
		na := cs.NodeAuthorization
		// NodeAuthorizerSpec
		if na.NodeAuthorizer != nil {
			if na.NodeAuthorizer.Authorizer == "" {
				switch kops.CloudProviderID(cs.CloudProvider) {
				case kops.CloudProviderAWS:
					na.NodeAuthorizer.Authorizer = "aws"
				default:
					na.NodeAuthorizer.Authorizer = "alwaysallow"
				}
			}
			if na.NodeAuthorizer.Image == "" {
				na.NodeAuthorizer.Image = GetNodeAuthorizerImage()
			}
			if na.NodeAuthorizer.Port == 0 {
				na.NodeAuthorizer.Port = DefaultPort
			}
			if na.NodeAuthorizer.Timeout == nil {
				na.NodeAuthorizer.Timeout = DefaultTimeout
			}
			if na.NodeAuthorizer.TokenTTL == nil {
				na.NodeAuthorizer.TokenTTL = DefaultTokenTTL
			}
			if na.NodeAuthorizer.NodeURL == "" {
				na.NodeAuthorizer.NodeURL = fmt.Sprintf("https://node-authorizer-internal.%s:%d", b.Context.ClusterName, na.NodeAuthorizer.Port)
			}
			if na.NodeAuthorizer.Features == nil {
				features := []string{"verify-registration", "verify-ip"}

				switch kops.CloudProviderID(cs.CloudProvider) {
				case kops.CloudProviderAWS:
					features = append(features, "verify-signature")
				}
				na.NodeAuthorizer.Features = &features
			}
		}
	}

	return nil
}
74421
func (m *Mux) Options(pattern PatternType, handler HandlerType) {
	m.rt.handleUntyped(pattern, mOPTIONS, handler)
}
397536
func (this *AsciiRender) RenderOpts(asciiStr string, opts *RenderOptions) (string, error) {
	return this.render(asciiStr, opts)
}
1276658
func setOptions(settings *Settings, options []Option) error {
	for _, option := range options {
		if option == nil {
			return errInvalidOption
		}
		err := option(settings)
		if err != nil {
			return err
		}
	}
	return nil
}
786092
func NewOptions(ext Extender) *Options {
	// Use defaults except for Extender
	return &Options{
		DefaultUserAgent,
		DefaultRobotUserAgent,
		0,
		DefaultEnqueueChanBuffer,
		DefaultHostBufferFactor,
		DefaultCrawlDelay,
		DefaultIdleTTL,
		true,
		false,
		DefaultNormalizationFlags,
		LogError,
		ext,
	}
}
1240340
func (s *OptionGroupOption) SetOptionGroupOptionSettings(v []*OptionGroupOptionSetting) *OptionGroupOption {
	s.OptionGroupOptionSettings = v
	return s
}