// Returns its ExamplesGroups' descriptions as an array of string.
969389
func (example *Example) Descriptions() []string {
	segments := []string{}
	for _, ancestor := range example.ExampleGroup.ReverseAncestorsAndSelf() {
		segments = append(segments, ancestor.Description)
	}
	return segments
}
220489
func (c *Conn) ObjectGroups(attr, value string, groups []string) ([]string, error) {
	entry, err := c.GetAttributes(attr, value, []string{"memberOf"})
	if err != nil {
		return nil, err
	}
	var objectGroups []string

	for _, objectGroup := range entry.GetAttributeValues("memberOf") {
		for _, parentGroup := range groups {
			if objectGroup == parentGroup {
				objectGroups = append(objectGroups, parentGroup)
				continue
			}
		}
	}

	return objectGroups, nil
}
1252720
func (re *Regexp) GetGroupNames() []string {
	var result []string

	if re.capslist == nil {
		result = make([]string, re.capsize)

		for i := 0; i < len(result); i++ {
			result[i] = strconv.Itoa(i)
		}
	} else {
		result = make([]string, len(re.capslist))
		copy(result, re.capslist)
	}

	return result
}
1012936
func (inst *DenseInstances) AllAttributeGroups() map[string]AttributeGroup {
	ret := make(map[string]AttributeGroup)
	for a := range inst.agMap {
		ret[a] = inst.ags[inst.agMap[a]]
	}
	return ret
}
772192
func Examples(s string) string {
	if len(s) == 0 {
		return s
	}
	return normalizer{s}.trim().indent().string
}
1215448
func (b *NaiveBayes) String() string {
	return fmt.Sprintf("h(θ) = argmax_c{log(P(y = c)) + Σlog(P(x|y = c))}\n\tClasses: %v\n\tDocuments evaluated in model: %v\n\tWords evaluated in model: %v\n", len(b.Count), int(b.DocumentCount), int(b.DictCount))
}
271937
func ExplainsAsJSON(explains []*Explain) string {
	explainJSON, _ := jsonutil.MarshalIndentNoEscape(explains, "", "    ")
	return string(explainJSON)
}
374023
func (client *Client) DescribeScalingGroups(args *DescribeScalingGroupsArgs) (groups []ScalingGroupItemType, pagination *common.PaginationResult, err error) {
	args.Validate()
	response := DescribeInstancesResponse{}

	err = client.InvokeByFlattenMethod("DescribeScalingGroups", args, &response)

	if err == nil {
		return response.ScalingGroups.ScalingGroup, &response.PaginationResult, nil
	}

	return nil, nil, err
}
889436
func (g *Group) Find(shortDescription string) *Group {
	lshortDescription := strings.ToLower(shortDescription)

	var ret *Group

	g.eachGroup(func(gg *Group) {
		if gg != g && strings.ToLower(gg.ShortDescription) == lshortDescription {
			ret = gg
		}
	})

	return ret
}
780080
func (r *ReferenceBuilder) AddGroups(inputs []string) {
	for _, s := range inputs {
		groups := strings.Split(s, "+")
		if len(groups) == 1 {
			r.errs = append(r.errs, fmt.Errorf("group %q only contains a single name", s))
			continue
		}
		to := -1
		for _, group := range groups {
			var match ComponentReference
			for _, ref := range r.refs {
				if group == ref.Input().Value {
					match = ref
					break
				}
			}
			if match == nil {
				r.errs = append(r.errs, fmt.Errorf("the name %q from the group definition is not in use, and can't be used", group))
				break
			}
			if to == -1 {
				to = match.Input().GroupID
			} else {
				match.Input().GroupID = to
			}
		}
	}
}
672109
func (b *Broker) DescribeGroups(request *DescribeGroupsRequest) (*DescribeGroupsResponse, error) {
	response := new(DescribeGroupsResponse)

	err := b.sendAndReceive(request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
811610
func (bridge *Bridge) GetGroups() ([]Group, error) {
	uri := fmt.Sprintf("/api/%s/groups", bridge.Username)
	body, _, err := bridge.Get(uri)
	if err != nil {
		return []Group{}, err
	}

	//fmt.Println("GROUP GET: ", string(body))

	groups := map[string]Group{}
	err = json.Unmarshal(body, &groups)
	if err != nil {
		return []Group{}, err
	}
	//fmt.Println("GROUPS: ", groups)

	return []Group{}, nil
}
497783
func (cgi *ConsumergroupInstance) marshalSubscription(topics []string) ([]byte, error) {
	subscription := make(map[string]int)
	for _, topic := range topics {
		subscription[topic] = 1
	}
	data, err := json.Marshal(&Registration{
		Pattern:      RegPatternStatic,
		Subscription: subscription,
		Timestamp:    time.Now().Unix(),
		Version:      RegDefaultVersion,
	})
	if err != nil {
		return nil, err
	}
	return data, nil
}
641758
func (r *Reference) Strings() [2]string {
	var o [2]string
	o[0] = r.Name().String()

	switch r.Type() {
	case HashReference:
		o[1] = r.Hash().String()
	case SymbolicReference:
		o[1] = symrefPrefix + r.Target().String()
	}

	return o
}
1254634
func Description(d string) {
	switch def := dslengine.CurrentDefinition().(type) {
	case *design.APIDefinition:
		def.Description = d
	case *design.ResourceDefinition:
		def.Description = d
	case *design.FileServerDefinition:
		def.Description = d
	case *design.ActionDefinition:
		def.Description = d
	case *design.MediaTypeDefinition:
		def.Description = d
	case *design.AttributeDefinition:
		def.Description = d
	case *design.ResponseDefinition:
		def.Description = d
	case *design.DocsDefinition:
		def.Description = d
	case *design.SecuritySchemeDefinition:
		def.Description = d
	default:
		dslengine.IncompatibleDSL()
	}
}
1110532
func (ec2i *FakeEC2Impl) DescribeInstances(request *ec2.DescribeInstancesInput) ([]*ec2.Instance, error) {
	matches := []*ec2.Instance{}
	for _, instance := range ec2i.aws.instances {
		if request.InstanceIds != nil {
			if instance.InstanceId == nil {
				klog.Warning("Instance with no instance id: ", instance)
				continue
			}

			found := false
			for _, instanceID := range request.InstanceIds {
				if *instanceID == *instance.InstanceId {
					found = true
					break
				}
			}
			if !found {
				continue
			}
		}
		if request.Filters != nil {
			allMatch := true
			for _, filter := range request.Filters {
				if !instanceMatchesFilter(instance, filter) {
					allMatch = false
					break
				}
			}
			if !allMatch {
				continue
			}
		}
		matches = append(matches, instance)
	}

	return matches, nil
}
283351
func getFeatures(b []byte, r *regexp.Regexp) []Feature {
	words := r.FindAll(b, -1)
	features := make([]Feature, len(words))
	for i, w := range words {
		features[i] = NewFeature(w)
	}
	return features
}