// getSplitEntropy determines the entropy of the target
// class distribution after splitting on an base.Attribute
489077
func getSplitEntropy(s map[string]map[string]int) float64 {
	ret := 0.0
	count := 0
	for a := range s {
		for c := range s[a] {
			count += s[a][c]
		}
	}
	for a := range s {
		total := 0.0
		for c := range s[a] {
			total += float64(s[a][c])
		}
		for c := range s[a] {
			ret -= float64(s[a][c]) / float64(count) * math.Log(float64(s[a][c])/float64(count)) / math.Log(2)
		}
		ret += total / float64(count) * math.Log(total/float64(count)) / math.Log(2)
	}
	return ret
}
76200
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByName(name string, opts ...OptionFunc) (*GlobalLoadBalancerRule, int, error) {
	id, count, err := s.GetGlobalLoadBalancerRuleID(name, opts...)
	if err != nil {
		return nil, count, err
	}

	r, count, err := s.GetGlobalLoadBalancerRuleByID(id, opts...)
	if err != nil {
		return nil, count, err
	}
	return r, count, nil
}
632996
func (co *Context) GetRNNParamsSize(rnnDesc *RNN, xDesc *TensorDescriptor, dataType DataType) (sizeInBytes uintptr, err error) {
	var sizeInBytesC C.size_t
	// call cudnnGetRNNParamsSize
	err = result(C.cudnnGetRNNParamsSize(co.internal, rnnDesc.internal, xDesc.internal, &sizeInBytesC, dataType.C()))
	sizeInBytes = uintptr(sizeInBytesC)
	return
}
1270200
func GetApplyPatch(obj runtime.Unstructured) ([]byte, []byte, types.PatchType, error) {
	beforeJSON, err := encodeToJSON(obj)
	if err != nil {
		return nil, []byte(""), types.MergePatchType, err
	}
	objCopy := obj.DeepCopyObject()
	accessor := meta.NewAccessor()
	annotations, err := accessor.Annotations(objCopy)
	if err != nil {
		return nil, beforeJSON, types.MergePatchType, err
	}
	if annotations == nil {
		annotations = map[string]string{}
	}
	annotations[corev1.LastAppliedConfigAnnotation] = string(beforeJSON)
	accessor.SetAnnotations(objCopy, annotations)
	afterJSON, err := encodeToJSON(objCopy.(runtime.Unstructured))
	if err != nil {
		return nil, beforeJSON, types.MergePatchType, err
	}
	patch, err := jsonpatch.CreateMergePatch(beforeJSON, afterJSON)
	return patch, beforeJSON, types.MergePatchType, err
}
1056908
func GetAttribute(o *js.Object, key string) string {
	return o.Call("getAttribute", key).String()
}
1214904
func (p *propPlanID) GetPlanID() int64 {
	if p.Plan == nil {
		return -1
	}
	return p.Plan.GetID()
}
431305
func (sbc StackedBarChart) GetColorPalette() ColorPalette {
	if sbc.ColorPalette != nil {
		return sbc.ColorPalette
	}
	return AlternateColorPalette
}
413770
func Entropy(input Float64Data) (float64, error) {
	input, err := normalize(input)
	if err != nil {
		return math.NaN(), err
	}
	var result float64
	for i := 0; i < input.Len(); i++ {
		v := input.Get(i)
		if v == 0 {
			continue
		}
		result += (v * math.Log(v))
	}
	return -result, nil
}
1190321
func getClusterType(l2Entry uint64) int {
	switch l2Entry {
	case OFLAG_COMPRESSED:
		return int(CLUSTER_COMPRESSED)
	case OFLAG_ZERO:
		return int(CLUSTER_ZERO)
	case L2E_OFFSET_MASK:
		return int(CLUSTER_UNALLOCATED)
	default:
		return int(CLUSTER_NORMAL)
	}
}
325328
func (w *Window) GetAttrib(attrib Hint) int {
	ret := int(C.glfwGetWindowAttrib(w.data, C.int(attrib)))
	panicError()
	return ret
}
744269
func (o *AutoPageBreaks) getSheetPrOption(pr *xlsxSheetPr) {
	// Excel default: false
	if pr == nil || pr.PageSetUpPr == nil {
		*o = false
		return
	}
	*o = AutoPageBreaks(pr.PageSetUpPr.AutoPageBreaks)
}
1169900
func GetClassDistributionAfterThreshold(inst FixedDataGrid, at Attribute, val float64) map[string]map[string]int {
	ret := make(map[string]map[string]int)

	// Find the attribute we're decomposing on
	attrSpec, err := inst.GetAttribute(at)
	if err != nil {
		panic(fmt.Sprintf("Invalid attribute %s (%s)", at, err))
	}

	// Validate
	if _, ok := at.(*FloatAttribute); !ok {
		panic(fmt.Sprintf("Must be numeric!"))
	}

	_, rows := inst.Size()

	for i := 0; i < rows; i++ {
		splitVal := UnpackBytesToFloat(inst.Get(attrSpec, i)) > val
		splitVar := "0"
		if splitVal {
			splitVar = "1"
		}
		classVar := GetClass(inst, i)
		if _, ok := ret[splitVar]; !ok {
			ret[splitVar] = make(map[string]int)
			i--
			continue
		}
		ret[splitVar][classVar]++
	}

	return ret
}
217363
func (r Metric_Tracking_Object) GetSummary(graphType *string) (resp datatypes.Container_Metric_Tracking_Object_Summary, err error) {
	params := []interface{}{
		graphType,
	}
	err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getSummary", params, &r.Options, &resp)
	return
}
300995
func (obj *GenericDimension) GetDimension(ctx context.Context) (*NxLibraryDimensionDef, error) {
	result := &struct {
		Dim *NxLibraryDimensionDef	`json:"qDim"`
	} {}
	err := obj.rpc(ctx, "GetDimension", result)
	return result.Dim, err 
}
500796
func GetClassDistributionAfterSplit(inst FixedDataGrid, at Attribute) map[string]map[string]int {

	ret := make(map[string]map[string]int)

	// Find the attribute we're decomposing on
	attrSpec, err := inst.GetAttribute(at)
	if err != nil {
		panic(fmt.Sprintf("Invalid attribute %s (%s)", at, err))
	}

	_, rows := inst.Size()

	for i := 0; i < rows; i++ {
		splitVar := at.GetStringFromSysVal(inst.Get(attrSpec, i))
		classVar := GetClass(inst, i)
		if _, ok := ret[splitVar]; !ok {
			ret[splitVar] = make(map[string]int)
			i--
			continue
		}
		ret[splitVar][classVar]++
	}

	return ret
}
515597
func (w *Window) GetAttribute(attrib Hint) int {
	return int(C.glfwGetWindowAttrib(w.data, C.int(attrib)))
}
790719
func (api CompaniesAPI) GetCompanyList(w http.ResponseWriter, r *http.Request) {
	log.Warn("GetCompanyList is not implemented")
	http.Error(w, http.StatusText(http.StatusNotImplemented), http.StatusNotImplemented)
}