// SOASerialIfDefined returns the SOA's serial if the zone has a SOA record in the Apex, or
// -1 otherwise.
8740
func (z *Zone) SOASerialIfDefined() int64 {
	z.reloadMu.Lock()
	defer z.reloadMu.Unlock()
	if z.Apex.SOA != nil {
		return int64(z.Apex.SOA.Serial)
	}
	return -1
}
292293
func (parser *Parser) ParseDefinition(pkgName, typeName string, typeSpec *ast.TypeSpec) error {
	refTypeName := fullTypeName(pkgName, typeName)
	if _, isParsed := parser.swagger.Definitions[refTypeName]; isParsed {
		Println("Skipping '" + refTypeName + "', already parsed.")
		return nil
	}

	if parser.isInStructStack(refTypeName) {
		Println("Skipping '" + refTypeName + "', recursion detected.")
		return nil
	}
	parser.structStack = append(parser.structStack, refTypeName)

	Println("Generating " + refTypeName)

	schema, err := parser.parseTypeExpr(pkgName, typeName, typeSpec.Type)
	if err != nil {
		return err
	}
	parser.swagger.Definitions[refTypeName] = schema
	return nil
}
671238
func IsZeroOfUnderlyingType(x interface{}) bool {
	return reflect.DeepEqual(x, reflect.Zero(reflect.TypeOf(x)).Interface())
}
30245
func (d *Decoder) UseDecodeInterfaceLoose(flag bool) *Decoder {
	d.useLoose = flag
	return d
}
105067
func (p *Backoff) initEntryUnsafe(id string) *backoffEntry {
	entry := &backoffEntry{backoff: p.defaultDuration}
	p.perItemBackoff[id] = entry
	return entry
}
916283
func (fbo *folderBranchOps) markForReIdentifyIfNeeded(now time.Time, maxValid time.Duration) {
	fbo.identifyLock.Lock()
	defer fbo.identifyLock.Unlock()
	if fbo.identifyDone && (now.Before(fbo.identifyTime) || fbo.identifyTime.Add(maxValid).Before(now)) {
		fbo.log.CDebugf(nil, "Expiring identify from %v", fbo.identifyTime)
		fbo.identifyDone = false
	}
}
226665
func Parse(f io.Reader, origin, fileName string, serial int64) (*Zone, error) {
	tokens := dns.ParseZone(f, dns.Fqdn(origin), fileName)
	z := NewZone(origin, fileName)
	seenSOA := false
	for x := range tokens {
		if x.Error != nil {
			return nil, x.Error
		}

		if !seenSOA && serial >= 0 {
			if s, ok := x.RR.(*dns.SOA); ok {
				if s.Serial == uint32(serial) { // same serial
					return nil, &serialErr{err: "no change in SOA serial", origin: origin, zone: fileName, serial: serial}
				}
				seenSOA = true
			}
		}

		if err := z.Insert(x.RR); err != nil {
			return nil, err
		}
	}
	if !seenSOA {
		return nil, fmt.Errorf("file %q has no SOA record", fileName)
	}

	return z, nil
}
999521
func DriverTypeSimpleValueOf(s string) (DriverType, error) {
	obj, err := simpleValueOf("driver_type", DriverType_value, s)
	return DriverType(obj), err
}
112933
func (s *DocumentStatistics) analyzeDefinition(path string, definition *openapi.Schema) {
	s.DefinitionCount++
	typeName := typeNameForSchema(definition)
	switch typeName {
	case "object":
		if definition.Properties != nil {
			for _, pair := range definition.Properties.AdditionalProperties {
				propertySchema := pair.Value
				propertyType := typeForSchema(propertySchema)
				s.addDefinitionFieldType(path+"/"+pair.Name, propertyType)
			}
		}
	case "array":
		s.addDefinitionArrayType(path+"/", typeForSchema(definition))
	default: // string, boolean, integer, number, null...
		s.addDefinitionPrimitiveType(path+"/", typeName)
	}
}
198036
func WithSeccompUnconfined(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
	setLinux(s)
	s.Linux.Seccomp = nil
	return nil
}
598982
func (h *Headers) HasCorsHeadersDefined() bool {
	return h != nil && (h.AccessControlAllowCredentials ||
		len(h.AccessControlAllowHeaders) != 0 ||
		len(h.AccessControlAllowMethods) != 0 ||
		h.AccessControlAllowOrigin != "" ||
		len(h.AccessControlExposeHeaders) != 0 ||
		h.AccessControlMaxAge != 0 ||
		h.AddVaryHeader)
}
499319
func (b *BindObject) IsAssignable(to reflect.Type) bool {
	return equalTypes(b.Type, to)
}
1032475
func (n NetworkMode) IsUserDefined() bool {
	return !n.IsDefault() && !n.IsNone() && !n.IsBridge() && !n.IsContainer()
}
1022705
func FindServiceForFile(f *pb.FileDescriptorProto, name string) int {
	for i, x := range f.GetService() {
		if x.GetName() == name {
			return i
		}
	}
	return -1
}
157313
func (p *Parser) parseDropContinuousQueryStatement() (*DropContinuousQueryStatement, error) {
	stmt := &DropContinuousQueryStatement{}

	// Read the id of the query to drop.
	ident, err := p.ParseIdent()
	if err != nil {
		return nil, err
	}
	stmt.Name = ident

	// Expect an "ON" keyword.
	if tok, pos, lit := p.ScanIgnoreWhitespace(); tok != ON {
		return nil, newParseError(tokstr(tok, lit), []string{"ON"}, pos)
	}

	// Read the name of the database to remove the query from.
	if ident, err = p.ParseIdent(); err != nil {
		return nil, err
	}
	stmt.Database = ident

	return stmt, nil
}
600237
func (s *StorediSCSIVolume) SetPreservedExistingData(v bool) *StorediSCSIVolume {
	s.PreservedExistingData = &v
	return s
}
1362399
func (c *expressionCompiler) expressionRefersToJoinedData(e criteria.Expression) (*TableJoin, bool) {
	switch t := e.(type) {
	case *criteria.FieldExpression:
		for _, j := range c.joins {
			if j.HandlesFieldName(t.FieldName) {
				j.Active = true
				return j, true
			}
		}
	}
	return nil, false
}