// Classify classifies the Type t, it returns its Class.
549500
func Classify(t Type) Class {
	switch t {
	case NoError, Delegation:
		return Success
	case NameError, NoData:
		return Denial
	case OtherError:
		fallthrough
	default:
		return Error
	}
}
1350682
func (s *Patch) SetClassification(v string) *Patch {
	s.Classification = &v
	return s
}
629149
func (s *CountService) Types(types ...string) *CountService {
	if s.typ == nil {
		s.typ = make([]string, 0)
	}
	s.typ = append(s.typ, types...)
	return s
}
736110
func (s *CountService) Type(typ ...string) *CountService {
	if s.typ == nil {
		s.typ = make([]string, 0)
	}
	s.typ = append(s.typ, typ...)
	return s
}
1275714
func ReloadKNNClassifier(filePath string) (*KNNClassifier, error) {
	stub := &KNNClassifier{}
	err := stub.Load(filePath)
	if err != nil {
		return nil, err
	}
	return stub, nil
}
1104492
func (s *GrokClassifier) SetClassification(v string) *GrokClassifier {
	s.Classification = &v
	return s
}
945512
func (f *FieldSetType) AddClass(class string) *FieldSetType {
	f.class[class] = struct{}{}
	return f
}
272325
func (inv *Investigate) Categorization(domain string, labels bool) (*DomainCategorization, error) {
	uri, err := catUri(domain, labels)
	if err != nil {
		inv.Logf("%v", err)
		return nil, err
	}
	resp := make(map[string]DomainCategorization)
	err = inv.GetParse(uri, resp)
	if err != nil {
		return nil, err
	}
	if cat, ok := resp[domain]; !ok {
		return nil, errors.New("received a malformed response body")
	} else {
		return &cat, nil
	}
}
843487
func (s *SearchService) Type(typ string) *SearchService {
	if s.types == nil {
		s.types = []string{typ}
	} else {
		s.types = append(s.types, typ)
	}
	return s
}
1142968
func GetType(tname string) (reflect.Type, error) {
	t, found := typemap[tname]
	if !found {
		return nil, errors.New("type not found: " + tname)
	}
	return t, nil

}
372573
func (p *TCompactProtocol) getTType(t tCompactType) (TType, error) {
	switch byte(t) & 0x0f {
	case STOP:
		return STOP, nil
	case COMPACT_BOOLEAN_FALSE:
	case COMPACT_BOOLEAN_TRUE:
		return BOOL, nil
	case COMPACT_BYTE:
		return BYTE, nil
	case COMPACT_I16:
		return I16, nil
	case COMPACT_I32:
		return I32, nil
	case COMPACT_I64:
		return I64, nil
	case COMPACT_DOUBLE:
		return DOUBLE, nil
	case COMPACT_BINARY:
		return STRING, nil
	case COMPACT_LIST:
		return LIST, nil
	case COMPACT_SET:
		return SET, nil
	case COMPACT_MAP:
		return MAP, nil
	case COMPACT_STRUCT:
		return STRUCT, nil
	}
	return STOP, TException(fmt.Errorf("don't know what type: %s", t&0x0f))
}
1072459
func Type(tname string) reflect.Type {
	if t, found := typemap[tname]; found {
		return t
	}
	panic("Type not found: " + tname)
}
840503
func (s *GetMappingService) Type(typ ...string) *GetMappingService {
	s.typ = append(s.typ, typ...)
	return s
}
437230
func (s *ScriptSort) Type(typ string) *ScriptSort {
	s.typ = typ
	return s
}
701068
func (s *Selection) ToggleClass(class ...string) *Selection {
	classStr := strings.TrimSpace(strings.Join(class, " "))

	if classStr == "" {
		return s
	}

	tcls := getClassesSlice(classStr)

	for _, n := range s.Nodes {
		classes, attr := getClassesAndAttr(n, true)
		for _, tcl := range tcls {
			if strings.Contains(classes, " "+tcl+" ") {
				classes = strings.Replace(classes, " "+tcl+" ", " ", -1)
			} else {
				classes += tcl + " "
			}
		}

		setClasses(n, attr, classes)
	}

	return s
}
388087
func (s *UpdateXMLClassifierRequest) SetClassification(v string) *UpdateXMLClassifierRequest {
	s.Classification = &v
	return s
}
541471
func (s *ExplainService) Type(typ string) *ExplainService {
	s.typ = typ
	return s
}