// Error in spec, which is either mistake format or content inconsistency, and
// is checked when elements are being added to Sandbox.
428869
func NewSpecError(id, cause string) *CommonError {
	return &CommonError{
		errType:   ET_SPEC,
		contextId: id,
		cause:     "spec error: " + cause,
	}
}
792961
func (m *Matcher) Validate() error {
	var errs []error
	if m.NamespaceLister == nil {
		errs = append(errs, fmt.Errorf("the namespace matcher requires a namespaceLister"))
	}
	if m.Client == nil {
		errs = append(errs, fmt.Errorf("the namespace matcher requires a namespaceLister"))
	}
	return utilerrors.NewAggregate(errs)
}
386978
func Error(err error) SassValue {
	return SassValue{value: libs.MakeError(err.Error())}
}
24776
func (p *Policy) SkipElementsContent(names ...string) *Policy {

	p.init()

	for _, element := range names {
		element = strings.ToLower(element)

		if _, ok := p.setOfElementsToSkipContent[element]; !ok {
			p.setOfElementsToSkipContent[element] = struct{}{}
		}
	}

	return p
}
165691
func (i *InvalidHtlcSigError) Error() string {
	return fmt.Sprintf("rejected commitment: commit_height=%v, "+
		"invalid_htlc_sig=%x, commit_tx=%x, sig_hash=%x", i.commitHeight,
		i.htlcSig, i.commitTx, i.sigHash[:])
}
332850
func Parameter(markup ...trees.Appliable) *trees.Element {
	e := trees.NewElement("param", true)
	for _, m := range markup {
		m.Apply(e)
	}
	return e
}
775892
func (element *Element) parseInlineStyle() ([]*StyleRule, error) {
	result := []*StyleRule{}

	styleValue, exists := element.elt.Attr("style")
	if (styleValue == "") || !exists {
		return result, nil
	}

	declarations, err := parser.ParseDeclarations(styleValue)
	if err != nil {
		return result, err
	}

	result = append(result, NewStyleRule(inlineFakeSelector, declarations))

	return result, nil
}
510174
func (e ShardError) Error() string {
	return fmt.Sprintf("[shard %d] %s", e.id, e.Err)
}
546098
func (inliner *Inliner) collectElementsAndRules() {
	for _, stylesheet := range inliner.stylesheets {
		for _, rule := range stylesheet.Rules {
			if rule.Kind == css.QualifiedRule {
				// Let's go!
				inliner.handleQualifiedRule(rule)
			} else {
				// Keep it 'as is'
				inliner.rawRules = append(inliner.rawRules, rule)
			}
		}
	}
}
480662
func ErrorWithExtrasAndContext(ctx context.Context, level string, err error, extras map[string]interface{}) {
	std.ErrorWithExtrasAndContext(ctx, level, err, extras)
}
818590
func RequestErrorWithExtrasAndContext(ctx context.Context, level string, r *http.Request, err error, extras map[string]interface{}) {
	std.RequestErrorWithExtrasAndContext(ctx, level, r, err, extras)
}
903446
func IsExifError(err error) bool {
	if te, ok := err.(tiffErrors); ok {
		_, isExif := te[loadExif]
		return isExif
	}
	return false
}
837611
func NewBlockAttrs(name, elementType string, required bool) *Spec {
	return BlockAttrsSpec(&BlockAttrs{
		Name:     name,
		Required: required,
		Type:     elementType,
	})
}
150273
func ValidateStatefulSet(statefulSet *apps.StatefulSet) field.ErrorList {
	allErrs := apivalidation.ValidateObjectMeta(&statefulSet.ObjectMeta, true, ValidateStatefulSetName, field.NewPath("metadata"))
	allErrs = append(allErrs, ValidateStatefulSetSpec(&statefulSet.Spec, field.NewPath("spec"))...)
	return allErrs
}
437183
func (_m *APIClient) ContainerInspect(ctx context.Context, _a1 string) (types.ContainerJSON, error) {
	ret := _m.Called(ctx, _a1)

	var r0 types.ContainerJSON
	if rf, ok := ret.Get(0).(func(context.Context, string) types.ContainerJSON); ok {
		r0 = rf(ctx, _a1)
	} else {
		r0 = ret.Get(0).(types.ContainerJSON)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
66696
func (m *MediaTypeDefinition) IsError() bool {
	base, params, err := mime.ParseMediaType(m.Identifier)
	if err != nil {
		panic("invalid media type identifier " + m.Identifier) // bug
	}
	delete(params, "view")
	return mime.FormatMediaType(base, params) == ErrorMedia.Identifier
}
943291
func main() {
	if len(os.Args) != 3 {
		log.Fatalf("Usage: %s CRDSPEC TYPE", os.Args[0])
	}
	crdPath := os.Args[1]
	typePath := os.Args[2]

	data, err := ioutil.ReadFile(crdPath)
	if err != nil {
		log.Fatal(err)
	}
	var crd apiextensions.CustomResourceDefinition
	err = yaml.Unmarshal(data, &crd)
	if err != nil {
		log.Fatal(err)
	}
	crd.Spec.Validation = crdutil.GetCustomResourceValidation(typePath, v1alpha1.GetOpenAPIDefinitions)

	jsonBytes, err := json.Marshal(crd)
	if err != nil {
		log.Fatal(err)
	}

	var r unstructured.Unstructured
	if err := json.Unmarshal(jsonBytes, &r.Object); err != nil {
		log.Fatal(err)
	}

	unstructured.RemoveNestedField(r.Object, "status")
	unstructured.RemoveNestedField(r.Object, "metadata", "creationTimestamp")
	jsonBytes, err = json.MarshalIndent(r.Object, "", "    ")
	if err != nil {
		log.Fatal(err)
	}
	yamlBytes, err := yaml.JSONToYAML(jsonBytes)
	if err != nil {
		log.Fatal(err)
	}

	err = ioutil.WriteFile(crdPath, yamlBytes, 0644)
	if err != nil {
		panic(err)
	}
	os.Exit(0)

}