// Ref returns a ref component of a project-rooted config set or empty string
// for all other sets.
//
// Use ProjectAndRef if you need to get both the project name and the ref.
162927
func (cs Set) Ref() string {
	domain, _, ref := cs.Split()
	if domain == "projects" {
		return ref
	}
	return ""
}
190050
func (c *Domain) Ref() error {
	var err C.virError
	ret := C.virDomainRefWrapper(c.ptr, &err)
	if ret == -1 {
		return makeError(&err)
	}
	return nil
}
1110801
func parseTemplateReference(s string) (templateReference, error) {
	var ref templateReference
	parts := strings.Split(s, "/")
	switch len(parts) {
	case 2:
		// namespace/name
		ref.Namespace = parts[0]
		ref.Name = parts[1]
		break
	case 1:
		// name
		ref.Name = parts[0]
		break
	default:
		return ref, fmt.Errorf("the template reference must be either the template name or namespace and template name separated by slashes")
	}
	return ref, nil
}
1125491
func (r *Reference) GetRef() string {
	if r == nil || r.Ref == nil {
		return ""
	}
	return *r.Ref
}
1131175
func (vote *ProjectPostVote) Reference() Reference {
	post, _ := NewProjectPost(vote.Hpid)
	return post
}
222693
func (c *StorageVol) Ref() error {
	var err C.virError
	ret := C.virStorageVolRefWrapper(c.ptr, &err)
	if ret == -1 {
		return makeError(&err)
	}
	return nil
}
236163
func (n *NodeAbstractProvider) References() []*addrs.Reference {
	if n.Config == nil || n.Schema == nil {
		return nil
	}

	return ReferencesFromConfig(n.Config.Config, n.Schema)
}
1182026
func Refs(c context.Context, a Authority, path string, r MultiResolver, meta *[]*config.Meta) error {
	return getAll(c, a, backend.GetAllRef, path, r, meta)
}
1109292
func (p Path) Ref(head *ast.Term) (ref ast.Ref) {
	ref = make(ast.Ref, len(p)+1)
	ref[0] = head
	for i := range p {
		idx, err := strconv.ParseInt(p[i], 10, 64)
		if err == nil {
			ref[i+1] = ast.IntNumberTerm(int(idx))
		} else {
			ref[i+1] = ast.StringTerm(p[i])
		}
	}
	return ref
}
568163
func (n *NodeApplyableModuleVariable) References() []*addrs.Reference {

	// If we have no value expression, we cannot depend on anything.
	if n.Expr == nil {
		return nil
	}

	// Variables in the root don't depend on anything, because their values
	// are gathered prior to the graph walk and recorded in the context.
	if len(n.Addr.Module) == 0 {
		return nil
	}

	// Otherwise, we depend on anything referenced by our value expression.
	// We ignore diagnostics here under the assumption that we'll re-eval
	// all these things later and catch them then; for our purposes here,
	// we only care about valid references.
	//
	// Due to our GraphNodeReferenceOutside implementation, the addresses
	// returned by this function are interpreted in the _parent_ module from
	// where our associated variable was declared, which is correct because
	// our value expression is assigned within a "module" block in the parent
	// module.
	refs, _ := lang.ReferencesInExpr(n.Expr)
	return refs
}
70272
func (s *Spec) AllParameterReferences() (result []string) {
	for _, v := range s.references.parameters {
		result = append(result, v.String())
	}
	return
}
749940
func (domain *Domain) propertyNameForReference(reference string) *string {
	parts := strings.Split(reference, "/")
	first := parts[0]
	last := parts[len(parts)-1]
	if first == "#" {
		return &last
	}
	return nil
}
179276
func (vote *UserPostCommentVote) Reference() Reference {
	post, _ := NewUserPostComment(vote.Hcid)
	return post
}
733215
func Ref(name string, input interface{}, template interface{}) interface{} {

	// Dang son, this has got more nest than a bald eagle
	// Check the input is a string
	if name, ok := input.(string); ok {

		switch name {

		case "AWS::AccountId":
			return "123456789012"
		case "AWS::NotificationARNs": //
			return []string{"arn:aws:sns:us-east-1:123456789012:MyTopic"}
		case "AWS::NoValue":
			return nil
		case "AWS::Region":
			return "us-east-1"
		case "AWS::StackId":
			return "arn:aws:cloudformation:us-east-1:123456789012:stack/MyStack/1c2fa620-982a-11e3-aff7-50e2416294e0"
		case "AWS::StackName":
			return "goformation-stack"

		default:

			// This isn't a pseudo 'Ref' paramater, so we need to look inside the CloudFormation template
			// to see if we can resolve the reference. This implementation just looks at the Parameters section
			// to see if there is a parameter matching the name, and if so, return the default value.

			// Check the template is a map
			if template, ok := template.(map[string]interface{}); ok {
				// Check there is a parameters section
				if uparameters, ok := template["Parameters"]; ok {
					// Check the parameters section is a map
					if parameters, ok := uparameters.(map[string]interface{}); ok {
						// Check there is a parameter with the same name as the Ref
						if uparameter, ok := parameters[name]; ok {
							// Check the parameter is a map
							if parameter, ok := uparameter.(map[string]interface{}); ok {
								// Check the parameter has a default
								if def, ok := parameter["Default"]; ok {
									return def
								}
							}
						}
					}
				}
			}
		}

	}

	return nil

}
966669
func (c *RefManager) SetRef(id ContainerID, ref *v1.ObjectReference) {
	c.Lock()
	defer c.Unlock()
	c.containerIDToRef[id] = ref
}
846964
func (d *Domain) resolveReference(prop PropSetter) bool {

	if prop.GetRef() == "" {
		fmt.Printf("ref was empty: %s\n", prop.GetGoType())
		return false
	}
	refName := ""
	// Local reference, add . between domain/ref type so we can look it up in our globalRefs
	if !strings.Contains(prop.GetRef(), ".") {
		refName = d.Domain + "." + prop.GetRef()
	} else {
		refName = prop.GetRef()
	}

	ref := globalRefs[refName]
	fmt.Printf("REF (%s): %#v\n", refName, ref)
	// base type
	if ref.IsBaseType {
		prop.SetGoType(ref.BaseType)
	} else {
		// we can have this type, reference another type, which is just a base type
		// so just set that here.
		if ref2ref, ok := globalRefs[ref.RefToRefName]; ok {
			if ref2ref.IsBaseType {
				prop.SetGoType(ref2ref.BaseType)
			}
		} else {
			prop.SetGoType(ref.ExternalGoName)
		}
		prop.SetIsRef(true)
	}
	// set the type as being an array of whatever type it references
	if ref.IsArrayRef {
		prop.SetIsTypeArray(true)
	}
	// add enum possible values to description
	if ref.EnumDescription != "" {
		prop.SetDescription(prop.GetDescription() + ref.EnumDescription)
	}

	if isPointerType(prop) {
		prop.SetPointerType(true)
	}
	return true
}
1269241
func (r ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error) {
	if _, deleted := r.deleted[n]; deleted {
		return nil, plumbing.ErrReferenceNotFound
	}

	ref, err := r.temporal.Reference(n)
	if err == plumbing.ErrReferenceNotFound {
		return r.ReferenceStorer.Reference(n)
	}

	return ref, err
}