// IsSorted checks whether a slice of KSUIDs is sorted
1535
func IsSorted(ids []KSUID) bool {
	if len(ids) != 0 {
		min := ids[0]
		for _, id := range ids[1:] {
			if bytes.Compare(min[:], id[:]) > 0 {
				return false
			}
			min = id
		}
	}
	return true
}
741368
func (v *UUIDIsPresent) IsValid(errors *validate.Errors) {
	s := v.Field.String()
	if strings.TrimSpace(s) != "" && v.Field != uuid.Nil {
		return
	}

	if len(v.Message) > 0 {
		errors.Add(GenerateKey(v.Name), v.Message)
		return
	}

	errors.Add(GenerateKey(v.Name), fmt.Sprintf("%s can not be blank.", v.Name))
}
831068
func importSorted(imports map[string]string) []Import {
	names := make([]string, 0, len(imports))
	for n := range imports {
		names = append(names, n)
	}
	sort.Strings(names)
	result := make([]Import, len(names))
	for i, n := range names {
		result[i] = Import{n, imports[n]}
	}
	return result
}
693376
func (f PackedFormat) IsSupported(bitsPerValue int) bool {
	switch int(f) {
	case PACKED_SINGLE_BLOCK:
		return is64Supported(bitsPerValue)
	}
	return bitsPerValue >= 1 && bitsPerValue <= 64
}
397897
func (m xlMetaV1) IsValid() bool {
	return isXLMetaFormatValid(m.Version, m.Format) &&
		isXLMetaErasureInfoValid(m.Erasure.DataBlocks, m.Erasure.ParityBlocks)
}
1122991
func (f FieldMatchingFlags) IsSet(flag FieldMatchingFlags) bool {
	if flag == DestFromSource {
		// The bit logic doesn't work on the default value.
		return f&SourceToDest != SourceToDest
	}
	return f&flag == flag
}
1318889
func IsNoResultsError(err error) bool {
	switch errType := errors.Cause(err).(type) {
	case NoResultsError:
		return errType.NoResultsError()
	default:
		return false
	}
}
493570
func (r *Result) IsValid() bool {
	if r == nil {
		return true
	}
	return len(r.Errors) == 0
}
82794
func (o *Option) IsKey(key string) bool {
	return strings.ToLower(o.Key) == strings.ToLower(key)
}
379999
func (c *call) HasUndefined() bool {
	for i := range c.Args {
		if c.Args[i] == nil {
			return true
		}
		if basic, ok := c.Args[i].(*types.Basic); ok {
			if basic.Kind() == types.Invalid {
				return true
			}
		}
		if strings.Index(c.Args[i].String(), "invalid type") >= 0 {
			return true
		}
	}
	return false
}
60465
func IsStopped(ctx context.Context, client client.APIClient, containerID string) func(log poll.LogT) poll.Result {
	return func(log poll.LogT) poll.Result {
		inspect, err := client.ContainerInspect(ctx, containerID)

		switch {
		case err != nil:
			return poll.Error(err)
		case !inspect.State.Running:
			return poll.Success()
		default:
			return poll.Continue("waiting for container to be stopped")
		}
	}
}
1144353
func (d *Context) IsNullOrUndefined(index int) bool {
	return d.IsNull(index) || d.IsUndefined(index)
}
957980
func isSiteRoot(p string) bool {
	fi, err := os.Stat(filepath.Join(p, fs.SiteServiceDir))
	return err == nil && fi.IsDir()
}
1214606
func (s *AtomicSequence) IsStarted() bool {
	if !s.initialized {
		return false
	}
	return !(atomic.LoadUint64(&s.current) < atomic.LoadUint64(&s.minvalue)) &&
		atomic.LoadUint64(&s.current) < atomic.LoadUint64(&s.maxvalue)
}
716054
func getSortedPutPairs(updateMap BatchPutMap) batchPutPairList {
	res := batchPutPairList{}
	for item, updates := range updateMap {
		res = append(res, batchPutPair{item, updates})
	}

	sort.Sort(res)
	return res
}
30592
func IsMounted(dir string, log Log) (bool, error) {
	return false, fmt.Errorf("IsMounted unsupported on this platform")
}
360822
func IsEqual(data sort.Interface, pivot int) bool {
	k, l := pivot, data.Len()
	if k*2 != l {
		return false
	}
	for i := 0; i < k; i++ {
		p, q := k-i-1, l-i-1
		if data.Less(p, q) || data.Less(q, p) {
			return false
		}
	}
	return true
}