// NonEmpty returns a function that tests if a path is non-empty. A
// path is non-empty if a Read on the path returns a value or a Read
// on any of the path prefixes returns a non-object value.
326546
func NonEmpty(ctx context.Context, store Store, txn Transaction) func([]string) (bool, error) {
	return func(path []string) (bool, error) {
		if _, err := store.Read(ctx, txn, Path(path)); err == nil {
			return true, nil
		} else if !IsNotFound(err) {
			return false, err
		}
		for i := len(path) - 1; i > 0; i-- {
			val, err := store.Read(ctx, txn, Path(path[:i]))
			if err != nil && !IsNotFound(err) {
				return false, err
			} else if err == nil {
				if _, ok := val.(map[string]interface{}); ok {
					return false, nil
				}
				return true, nil
			}
		}
		return false, nil
	}
}
343886
func DirEmpty(dirPath string) (bool, error) {
	f, err := os.Open(dirPath)
	if err != nil {
		logger.Debugf("Error opening dir [%s]: %+v", dirPath, err)
		return false, errors.Wrapf(err, "error opening dir [%s]", dirPath)
	}
	defer f.Close()

	_, err = f.Readdir(1)
	if err == io.EOF {
		return true, nil
	}
	err = errors.Wrapf(err, "error checking if dir [%s] is empty", dirPath)
	return false, err
}
1167177
func isEmpty(object interface{}) bool {

	if object == nil {
		return true
	} else if object == "" {
		return true
	} else if object == false {
		return true
	}

	for _, v := range numericZeros {
		if object == v {
			return true
		}
	}

	objValue := reflect.ValueOf(object)

	switch objValue.Kind() {
	case reflect.Map:
		fallthrough
	case reflect.Slice, reflect.Chan:
		{
			return (objValue.Len() == 0)
		}
	case reflect.Struct:
		switch object.(type) {
		case time.Time:
			return object.(time.Time).IsZero()
		}
	case reflect.Ptr:
		{
			if objValue.IsNil() {
				return true
			}
			switch object.(type) {
			case *time.Time:
				return object.(*time.Time).IsZero()
			default:
				return false
			}
		}
	}
	return false
}
398389
func nonEmpty(ctx context.Context, client *trace.Client, jsonMetrics []samplers.JSONMetric) bool {

	span, _ := trace.StartSpanFromContext(ctx, "veneur.opentracing.import.nonEmpty")
	defer span.ClientFinish(client)

	sentinel := samplers.JSONMetric{}
	for _, metric := range jsonMetrics {
		if !reflect.DeepEqual(sentinel, metric) {
			// we have found at least one entry that is properly formed
			return true

		}
	}
	return false
}
1366969
func FprintfIfNotEmpty(w io.Writer, format string, v interface{}) {
	if v != nil && v != "" {
		fmt.Fprintf(w, format, v)
	}
}
180810
func IsDirEmpty(dirname string) (status bool, err error) {
	f, err := os.Open(dirname)
	if err == nil {
		defer f.Close()
		if _, err = f.Readdirnames(1); err == io.EOF {
			status = true
			err = nil
		}
	}

	return
}
472685
func (as *Assertion) ToBeEmpty() {
	if !as.isEmpty(as.Value) {
		as.Test.PrintError(fmt.Sprintf("Expected `%v` to be empty", as.Value))
	}
}
685045
func (grm *goRoutineMap) nothingPending() bool {
	nothingIsPending := true
	for _, operation := range grm.operations {
		if operation.operationPending {
			nothingIsPending = false
			break
		}
	}
	return nothingIsPending
}
727330
func CheckEmpty(dir string) error {
	return newWalker(func(path string, info os.FileInfo) error {
		// Leave the root dir alone
		if path == dir {
			return nil
		}
		// Report any other existing file as error
		return fmt.Errorf("Recycled volume is not empty")
	}).Walk(dir)
}
9080
func (schema *Schema) IsEmpty() bool {
	return (schema.Schema == nil) &&
		(schema.ID == nil) &&
		(schema.MultipleOf == nil) &&
		(schema.Maximum == nil) &&
		(schema.ExclusiveMaximum == nil) &&
		(schema.Minimum == nil) &&
		(schema.ExclusiveMinimum == nil) &&
		(schema.MaxLength == nil) &&
		(schema.MinLength == nil) &&
		(schema.Pattern == nil) &&
		(schema.AdditionalItems == nil) &&
		(schema.Items == nil) &&
		(schema.MaxItems == nil) &&
		(schema.MinItems == nil) &&
		(schema.UniqueItems == nil) &&
		(schema.MaxProperties == nil) &&
		(schema.MinProperties == nil) &&
		(schema.Required == nil) &&
		(schema.AdditionalProperties == nil) &&
		(schema.Properties == nil) &&
		(schema.PatternProperties == nil) &&
		(schema.Dependencies == nil) &&
		(schema.Enumeration == nil) &&
		(schema.Type == nil) &&
		(schema.AllOf == nil) &&
		(schema.AnyOf == nil) &&
		(schema.OneOf == nil) &&
		(schema.Not == nil) &&
		(schema.Definitions == nil) &&
		(schema.Title == nil) &&
		(schema.Description == nil) &&
		(schema.Default == nil) &&
		(schema.Format == nil) &&
		(schema.Ref == nil)
}
220054
func (f *Files) IsEmpty() bool {
	f.lk.Lock()
	defer f.lk.Unlock()
	return len(f.file) == 0
}
721045
func readIntegerNonEmpty(s []byte, length uint) uint64 {
	x := uint(0)
	v := uint64(0)
	for i := uint(0); i < length; i++ {
		v += uint64(s[i]) << x
		x += 8
	}
	return v
}
978697
func (enc *Encoder) Uint64NullEmpty(v uint64) {
	enc.grow(10)
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeByte(',')
	}
	if v == 0 {
		enc.writeBytes(nullBytes)
		return
	}
	enc.buf = strconv.AppendUint(enc.buf, v, 10)
}
1036978
func (q *Queue) IsEmpty() bool {
	return atomic.LoadUint64(q.write.processing) == atomic.LoadUint64(q.read.processing)
}
695116
func (enc *Encoder) Float32NullEmpty(v float32) {
	enc.grow(10)
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeByte(',')
	}
	if v == 0 {
		enc.writeBytes(nullBytes)
		return
	}
	enc.buf = strconv.AppendFloat(enc.buf, float64(v), 'f', -1, 32)
}
1335153
func (b *Bound) Empty() bool {
	return b.sw.X() >= b.ne.X() || b.sw.Y() >= b.ne.Y()
}
654520
func (id DocumentID) ValidateOrEmpty() error {
	if id == "" {
		return nil
	}
	if err := id.Validate(); err != nil {
		return WithStack(err)
	}
	return nil
}