code: func (v *Vars) Set(th *starlark.Thread, id ID, value starlark.Value) error {
  	if err := v.checkVarsAccess(th, id); err != nil {
  		return err
  	}
  
  	// Must be unset.
  	if cur := v.lookup(id); cur != nil {
  		if cur.auto {
  			return fmt.Errorf("variable reassignment is forbidden, the previous value was auto-set to the default as a side effect of 'get' at: %s", cur.trace)
  		}
  		return fmt.Errorf("variable reassignment is forbidden, the previous value was set at: %s", cur.trace)
  	}
  
  	return v.assign(th, id, value, false)
  }
docs: // Set sets the value of a variable within the current scope iff the variable
  // was unset before (in the current or any parent scopes).
  //
  // Variable can be assigned or read only from threads that perform 'exec' calls,
  // NOT when loading library modules via 'load' (the library modules must not
  // have side effects or depend on a transient state in vars), or executing
  // callbacks (callbacks do not have enough context to safely use vars).
  //
  // Freezes the value as a side effect.