// Publicizer publicizes a single attribute based on the type.
552142
func Publicizer(att *design.AttributeDefinition, sourceField, targetField string, dereference bool, depth int, init bool) string {
	var publication string
	data := map[string]interface{}{
		"sourceField": sourceField,
		"targetField": targetField,
		"depth":       depth,
		"att":         att,
		"dereference": dereference,
		"init":        init,
	}
	switch {
	case att.Type.IsPrimitive():
		publication = RunTemplate(simplePublicizeT, data)
	case att.Type.IsObject():
		if _, ok := att.Type.(*design.MediaTypeDefinition); ok {
			publication = RunTemplate(recursivePublicizeT, data)
		} else if _, ok := att.Type.(*design.UserTypeDefinition); ok {
			publication = RunTemplate(recursivePublicizeT, data)
		} else {
			publication = RunTemplate(objectPublicizeT, data)
		}
	case att.Type.IsArray():
		// If the array element is primitive type, we can simply copy the elements over (i.e) []string
		if att.Type.HasAttributes() {
			data["elemType"] = att.Type.ToArray().ElemType
			publication = RunTemplate(arrayPublicizeT, data)
		} else {
			publication = RunTemplate(simplePublicizeT, data)
		}
	case att.Type.IsHash():
		if att.Type.HasAttributes() {
			h := att.Type.ToHash()
			data["keyType"] = h.KeyType
			data["elemType"] = h.ElemType
			publication = RunTemplate(hashPublicizeT, data)
		} else {
			publication = RunTemplate(simplePublicizeT, data)
		}
	}
	return publication
}
960547
func (s SecretForDockerRegistryGeneratorV1) StructuredGenerate() (runtime.Object, error) {
	if err := s.validate(); err != nil {
		return nil, err
	}
	secret := &v1.Secret{}
	secret.Name = s.Name
	secret.Type = v1.SecretTypeDockerConfigJson
	secret.Data = map[string][]byte{}
	if len(s.FileSources) > 0 {
		if err := handleFromFileSources(secret, s.FileSources); err != nil {
			return nil, err
		}
	}
	if len(s.FileSources) == 0 {
		dockercfgJSONContent, err := handleDockerCfgJSONContent(s.Username, s.Password, s.Email, s.Server)
		if err != nil {
			return nil, err
		}
		secret.Data[v1.DockerConfigJsonKey] = dockercfgJSONContent
	}
	if s.AppendHash {
		h, err := hash.SecretHash(secret)
		if err != nil {
			return nil, err
		}
		secret.Name = fmt.Sprintf("%s-%s", secret.Name, h)
	}
	return secret, nil
}
639103
func VisibilityChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "visibilitychange", Listener: listener}
}
1082542
func (provider *SoundcloudProvider) PublicData(options map[string]interface{}) (interface{}, error) {
	return gomniauth.ProviderPublicData(provider, options)
}
134807
func (provider *SpotifyProvider) PublicData(options map[string]interface{}) (interface{}, error) {
	return gomniauth.ProviderPublicData(provider, options)
}
1075335
func Serializer(serializer reporter.SpanSerializer) ReporterOption {
	return func(r *httpReporter) {
		if serializer != nil {
			r.serializer = serializer
		}
	}
}
51169
func (ut *bottlePayload) Publicize() *BottlePayload {
	var pub BottlePayload
	if ut.Color != nil {
		pub.Color = ut.Color
	}
	if ut.Country != nil {
		pub.Country = ut.Country
	}
	if ut.Name != nil {
		pub.Name = ut.Name
	}
	if ut.Region != nil {
		pub.Region = ut.Region
	}
	if ut.Review != nil {
		pub.Review = ut.Review
	}
	if ut.Sweetness != nil {
		pub.Sweetness = ut.Sweetness
	}
	if ut.Varietal != nil {
		pub.Varietal = ut.Varietal
	}
	if ut.Vineyard != nil {
		pub.Vineyard = ut.Vineyard
	}
	if ut.Vintage != nil {
		pub.Vintage = ut.Vintage
	}
	return &pub
}
1207933
func typeIsPrimative(typ reflect.Type) bool {
	return typeIsString(typ) || typeIsNumeric(typ) || typeIsBool(typ)
}
567978
func (r Account) GetAttributeByType(attributeType *string) (resp datatypes.Account_Attribute, err error) {
	params := []interface{}{
		attributeType,
	}
	err = r.Session.DoRequest("SoftLayer_Account", "getAttributeByType", params, &r.Options, &resp)
	return
}
102143
func (i *macIdentity) Public() crypto.PublicKey {
	cert, err := i.Certificate()
	if err != nil {
		return nil
	}

	return cert.PublicKey
}
624808
func (c *Credentials) PublicData(options map[string]interface{}) (publicData interface{}, err error) {

	// ensure the ID is a string
	idValue := c.Map.Get(CredentialsKeyID).Data()
	var idStringValue string
	switch idValue.(type) {
	case float64:
		idStringValue = strconv.FormatFloat(idValue.(float64), 'g', -1, 64)
	case string:
		idStringValue = idValue.(string)
	default:
		idStringValue = fmt.Sprintf("%v", idValue)
	}
	c.Map.Set(CredentialsKeyID, idStringValue)

	return c.Map, nil
}
634341
func (s *sanitizer) printAttr(key, value string) {
	s.p(" ")
	s.p(key)
	s.p("=\"")
	s.p(html.EscapeString(value))
	s.p("\"")
}
1369755
func InitNotifier(model *m.AlertNotification) (Notifier, error) {
	notifierPlugin, found := notifierFactories[model.Type]
	if !found {
		return nil, errors.New("Unsupported notification type")
	}

	return notifierPlugin.Factory(model)
}
1217034
func (s *binaryNegationSimplifier) AcceptBinaryNegation(v tree.BinaryNegation) {
	val := s.Transform(v.Operand)
	s.Result = tree.Arithmetic{Op: tree.BINXOR, Left: val, Right: tree.NumericLiteral{uint64(0xFFFFFFFFFFFFFFFF)}}
}
535753
func (mc MSIConfig) Authorizer() (autorest.Authorizer, error) {
	msiEndpoint, err := adal.GetMSIVMEndpoint()
	if err != nil {
		return nil, err
	}

	var spToken *adal.ServicePrincipalToken
	if mc.ClientID == "" {
		spToken, err = adal.NewServicePrincipalTokenFromMSI(msiEndpoint, mc.Resource)
		if err != nil {
			return nil, fmt.Errorf("failed to get oauth token from MSI: %v", err)
		}
	} else {
		spToken, err = adal.NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, mc.Resource, mc.ClientID)
		if err != nil {
			return nil, fmt.Errorf("failed to get oauth token from MSI for user assigned identity: %v", err)
		}
	}

	return autorest.NewBearerAuthorizer(spToken), nil
}
1086132
func (sv *EvaluatorVisitor) AcceptBinaryNegation(v BinaryNegation) {
	v.Operand.Accept(sv)
	sv.pushNumeric(^sv.popNumeric())
}
479008
func (provider *UberProvider) PublicData(options map[string]interface{}) (interface{}, error) {
	return gomniauth.ProviderPublicData(provider, options)
}