code: func NewContext(n *api.NodeDescription, t *api.Task) (ctx Context) {
  	ctx.Service.ID = t.ServiceID
  	ctx.Service.Name = t.ServiceAnnotations.Name
  	ctx.Service.Labels = t.ServiceAnnotations.Labels
  
  	ctx.Node.ID = t.NodeID
  
  	// Add node information to context only if we have them available
  	if n != nil {
  		ctx.Node.Hostname = n.Hostname
  		ctx.Node.Platform = Platform{
  			Architecture: n.Platform.Architecture,
  			OS:           n.Platform.OS,
  		}
  	}
  	ctx.Task.ID = t.ID
  	ctx.Task.Name = naming.Task(t)
  
  	if t.Slot != 0 {
  		ctx.Task.Slot = fmt.Sprint(t.Slot)
  	} else {
  		// fall back to node id for slot when there is no slot
  		ctx.Task.Slot = t.NodeID
  	}
  
  	return
  }
docs: // NewContext returns a new template context from the data available in the
  // task and the node where it is scheduled to run.
  // The provided context can then be used to populate runtime values in a
  // ContainerSpec.