// builtinSetIntersection returns the intersection of the given input sets
971320
func builtinSetIntersection(a ast.Value) (ast.Value, error) {

	inputSet, err := builtins.SetOperand(a, 1)
	if err != nil {
		return nil, err
	}

	// empty input set
	if inputSet.Len() == 0 {
		return ast.NewSet(), nil
	}

	var result ast.Set

	err = inputSet.Iter(func(x *ast.Term) error {
		n, err := builtins.SetOperand(x.Value, 1)
		if err != nil {
			return err
		}

		if result == nil {
			result = n
		} else {
			result = result.Intersect(n)
		}
		return nil
	})
	return result, err
}
688098
func (s *AddApplicationInputProcessingConfigurationInput) SetInputProcessingConfiguration(v *InputProcessingConfiguration) *AddApplicationInputProcessingConfigurationInput {
	s.InputProcessingConfiguration = v
	return s
}
599217
func (el *ChannelEventListener) RegInputSelection() *ChannelEventListener {
	el.ExecutingInputSelection = make(chan bool)
	el.ids = append(el.ids, el.em.RegisterListener(func(data interface{}) {
		el.ExecutingInputSelection <- data.(bool)
	}, event.EventDoingInputSelection))
	return el
}
223435
func builtinSetDiff(a, b ast.Value) (ast.Value, error) {

	s1, err := builtins.SetOperand(a, 1)
	if err != nil {
		return nil, err
	}

	s2, err := builtins.SetOperand(b, 2)
	if err != nil {
		return nil, err
	}

	return s1.Diff(s2), nil
}
1250248
func (s *CreateTableInput) SetTableInput(v *TableInput) *CreateTableInput {
	s.TableInput = v
	return s
}
443048
func (s *InputConfiguration) SetInputStartingPositionConfiguration(v *InputStartingPositionConfiguration) *InputConfiguration {
	s.InputStartingPositionConfiguration = v
	return s
}
954640
func (s *CreatePartitionInput) SetPartitionInput(v *PartitionInput) *CreatePartitionInput {
	s.PartitionInput = v
	return s
}
1047580
func (s *InputUpdate) SetInputProcessingConfigurationUpdate(v *InputProcessingConfigurationUpdate) *InputUpdate {
	s.InputProcessingConfigurationUpdate = v
	return s
}
760118
func (s *HyperParameterAlgorithmSpecification) SetTrainingInputMode(v string) *HyperParameterAlgorithmSpecification {
	s.TrainingInputMode = &v
	return s
}
593233
func (s *StandardsSubscription) SetStandardsInput(v map[string]*string) *StandardsSubscription {
	s.StandardsInput = v
	return s
}
451223
func inSelectInTableIM(p *parser) bool {
	switch p.tok.Type {
	case StartTagToken, EndTagToken:
		switch p.tok.DataAtom {
		case a.Caption, a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr, a.Td, a.Th:
			if p.tok.Type == StartTagToken || p.elementInScope(tableScope, p.tok.DataAtom) {
				p.parseImpliedToken(EndTagToken, a.Select, a.Select.String())
				return false
			} else {
				// Ignore the token.
				return true
			}
		}
	}
	return inSelectIM(p)
}
1310590
func (s *Channel) SetInputSpecification(v *InputSpecification) *Channel {
	s.InputSpecification = v
	return s
}
1276063
func (g *Grok) ParseTyped(pattern string, text string) (map[string]interface{}, error) {
	gr, err := g.compile(pattern)
	if err != nil {
		return nil, err
	}
	match := gr.regexp.FindStringSubmatch(text)
	captures := make(map[string]interface{})
	if len(match) > 0 {
		for i, segmentName := range gr.regexp.SubexpNames() {
			if len(segmentName) != 0 {
				if g.config.RemoveEmptyValues == true && match[i] == "" {
					continue
				}
				name := g.nameToAlias(segmentName)
				if segmentType, ok := gr.typeInfo[segmentName]; ok {
					switch segmentType {
					case "int":
						captures[name], _ = strconv.Atoi(match[i])
					case "float":
						captures[name], _ = strconv.ParseFloat(match[i], 64)
					default:
						return nil, fmt.Errorf("ERROR the value %s cannot be converted to %s", match[i], segmentType)
					}
				} else {
					captures[name] = match[i]
				}
			}

		}
	}

	return captures, nil
}
24886
func (s *DiscoverInputSchemaInput) SetInputStartingPositionConfiguration(v *InputStartingPositionConfiguration) *DiscoverInputSchemaInput {
	s.InputStartingPositionConfiguration = v
	return s
}
1052765
func NewTextInput(name, label, text string) *TextInputElement {
	return &TextInputElement{
		DialogInput: DialogInput{
			Type:  InputTypeText,
			Name:  name,
			Label: label,
		},
		Value: text,
	}
}
1347393
func (e *Executor) ParseDestinationTarget(targetString string) (string, topodatapb.TabletType, key.Destination, error) {
	destKeyspace, destTabletType, dest, err := topoproto.ParseDestination(targetString, defaultTabletType)
	// Set default keyspace
	if destKeyspace == "" && len(e.VSchema().Keyspaces) == 1 {
		for k := range e.VSchema().Keyspaces {
			destKeyspace = k
		}
	}
	return destKeyspace, destTabletType, dest, err
}
720653
func NewResourceInput(init ...*ResourceInput) *ResourceInput {
	var o *ResourceInput
	if len(init) == 1 {
		o = init[0]
	} else {
		o = new(ResourceInput)
	}
	return o
}