code: func (r *Resource) Data(s *terraform.InstanceState) *ResourceData {
  	result, err := schemaMap(r.Schema).Data(s, nil)
  	if err != nil {
  		// At the time of writing, this isn't possible (Data never returns
  		// non-nil errors). We panic to find this in the future if we have to.
  		// I don't see a reason for Data to ever return an error.
  		panic(err)
  	}
  
  	// load the Resource timeouts
  	result.timeouts = r.Timeouts
  	if result.timeouts == nil {
  		result.timeouts = &ResourceTimeout{}
  	}
  
  	// Set the schema version to latest by default
  	result.meta = map[string]interface{}{
  		"schema_version": strconv.Itoa(r.SchemaVersion),
  	}
  
  	return result
  }
docs: // Data returns a ResourceData struct for this Resource. Each return value
  // is a separate copy and can be safely modified differently.
  //
  // The data returned from this function has no actual affect on the Resource
  // itself (including the state given to this function).
  //
  // This function is useful for unit tests and ResourceImporter functions.