func DoesFileExist(filename string) bool {
	info, err := os.Stat(filename)
	if os.IsNotExist(err) {
		return false
	}
	if info == nil {
		return false
	}
	return !info.IsDir()
}
DoesFileExist returns true if file exists
package mdb
import (
	"fmt"
	"os"
	"strconv"
	"strings"
)
const (
	outdir = "./out"
)
var CodeDefault = "\x1b[0m"
var CodeRed = "\x1b[31;1m"
var CodeGreen = "\x1b[32;1m"
var CodeYellow = "\x1b[33;1m"
var CodeBlue = "\x1b[34;1m"
type ChartDataPoint struct {
	label string
	value int64
}
func getTopChartPoints(chartPoints []ChartDataPoint, numPoints int) (string, []ChartDataPoint) {
	unit := 1024 * 1024 * 1024
	for unit > 1 {
		count := 0
		points := []ChartDataPoint{}
		for _, v := range chartPoints {
			val := int64(float64(v.value) / float64(unit))
			if val > 1 {
				count++
			}
			points = append(points, ChartDataPoint{label: v.label, value: val})
		}
		if count >= numPoints/2 || count == len(chartPoints) {
			if unit == 1024*1024*1024 {
				return "GB", points
			} else if unit == 1024*1024 {
				return "MB", points
			} else if unit == 1024 {
				return "KB", points
			}
		}
		unit /= 1024
	}
	return "B", chartPoints
}
func ToInt(num interface{}) int {
	f := fmt.Sprintf("%v", num)
	x, _ := strconv.ParseFloat(f, 64)
	return int(x)
}
func ToInt32(num interface{}) int32 {
	f := fmt.Sprintf("%v", num)
	x, _ := strconv.ParseFloat(f, 64)
	return int32(x)
}
func ToInt64(num interface{}) int64 {
	return toInt64(num)
}
func toInt64(num interface{}) int64 {
	f := fmt.Sprintf("%v", num)
	x, _ := strconv.ParseFloat(f, 64)
	return int64(x)
}
func ToFloat64(num interface{}) float64 {
	return toFloat64(num)
}
func toFloat64(num interface{}) float64 {
	f := fmt.Sprintf("%v", num)
	x, _ := strconv.ParseFloat(f, 64)
	return x
}
func SplitNamespace(namespace string) (string, string) {
	dot := strings.Index(namespace, ".")
	if dot < 0 {
		return "", ""
	}
	return namespace[:dot], namespace[dot+1:]
}
func SkipNamespace(namespace string, namespaceMap map[string]bool) bool {
	if len(namespaceMap) == 0 {
		return false
	}
	dbName, _ := SplitNamespace(namespace)
	allDB := dbName + ".*"
	if namespaceMap[allDB] || namespaceMap[namespace] {
		return false
	}
	return true
}