code: func (m *ReferenceMap) References(v dag.Vertex) ([]dag.Vertex, []addrs.Referenceable) {
  	rn, ok := v.(GraphNodeReferencer)
  	if !ok {
  		return nil, nil
  	}
  	if _, ok := v.(GraphNodeSubPath); !ok {
  		return nil, nil
  	}
  
  	var matches []dag.Vertex
  	var missing []addrs.Referenceable
  
  	for _, ref := range rn.References() {
  		subject := ref.Subject
  
  		key := m.referenceMapKey(v, subject)
  		if _, exists := m.vertices[key]; !exists {
  			// If what we were looking for was a ResourceInstance then we
  			// might be in a resource-oriented graph rather than an
  			// instance-oriented graph, and so we'll see if we have the
  			// resource itself instead.
  			switch ri := subject.(type) {
  			case addrs.ResourceInstance:
  				subject = ri.ContainingResource()
  			case addrs.ResourceInstancePhase:
  				subject = ri.ContainingResource()
  			}
  			key = m.referenceMapKey(v, subject)
  		}
  
  		vertices := m.vertices[key]
  		for _, rv := range vertices {
  			// don't include self-references
  			if rv == v {
  				continue
  			}
  			matches = append(matches, rv)
  		}
  		if len(vertices) == 0 {
  			missing = append(missing, ref.Subject)
  		}
  	}
  
  	return matches, missing
  }
docs: // References returns the set of vertices that the given vertex refers to,
  // and any referenced addresses that do not have corresponding vertices.