Getters and setters.
325859
function makeGetterSetter(name) {
        xkcd[name] = function (value) {
            if (arguments.length === 0) {
                return config[name];
            }
            config[name] = value;
            return xkcd;
        };
    }
567417
public static void setPropertyEL(Object obj, String prop, Object value) {

	// first check for field
	Field[] fields = getFieldsIgnoreCase(obj.getClass(), prop, null);
	if (!ArrayUtil.isEmpty(fields)) {
	    try {
		fields[0].set(obj, value);
		return;
	    }
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
	    }
	}

	// then check for setter
	try {
	    getSetter(obj, prop, value).invoke(obj);
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	}

    }
1219786
function useStateWithGetter(initial) {
  const ref = useRef();
  const [state, setState] = useState(initial);
  ref.current = state;
  const set = (value) => {
    ref.current = value;
    setState(value);
  };
  const get = () => {
    return ref.current;
  };
  return [state, set, get];
}
1111754
def set(self, obj, value):
        
        assert self.setter is not None, "Setter accessor is not specified."
        if callable(self.setter):
            return self.setter(obj, value)

        assert isinstance(self.setter, string_types), "Accessor must be a function or a dot-separated string."

        def _set(obj, attr, value):
            if isinstance(obj, dict):
                obj[attr] = value
            else:
                setattr(obj, attr, value)
            return value

        path = self.setter.split(".")
        for attr in path[:-1]:
            obj = _set(obj, attr, {})

        _set(obj, path[-1], value)
533408
function addGetterSetter(bindingHandlersObject) {
  Object.defineProperties(bindingHandlersObject, {
    'set': {
      configurable: true,
      value: function setBindingHandler(nameOrObject, value) {
        if (typeof nameOrObject === 'string') {
          bindingHandlersObject[nameOrObject] = value;
        } else if (typeof nameOrObject === 'object') {
          if (value !== undefined) {
            options.onError(
              new Error("Given extraneous `value` parameter (first param should be a string, but it was an object)." + nameOrObject));
          }
          extend(bindingHandlersObject, nameOrObject);
        } else {
          options.onError(
            new Error("Given a bad binding handler type: " + nameOrObject));
        }
      }
    },
    'get': {
      configurable: true,
      value: function getBindingHandler(name) {
        // NOTE: Strict binding checking ought to occur here.
        return bindingHandlersObject[name];
      }
    }
  });
}
946847
function set(values) {
    var s = this;

    if (arguments.length === 2) {
      values = {};
      var key = arguments[0];
      values[key] = arguments[1];
    }

    Object.assign(s, values);
    return s;
  }
253629
protected boolean isGetterOrSetter(String name, int index, boolean setter) {
        Slot slot = slotMap.query(name, index);
        if (slot instanceof GetterSlot) {
            if (setter && ((GetterSlot)slot).setter != null) return true;
            if (!setter && ((GetterSlot)slot).getter != null) return true;
        }
        return false;
    }
1195446
void store(int A, int r, int B) {
        getB(A, r).add(B);
        getA(B, r).add(A);
    }
1035088
private Method findSetter(Method []methods, String getterName, Class< ? > arg) {
        String setterName = "set" + getterName.substring(INT_VALUE);
	    
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];

            if (!method.getName().equals(setterName)) {
                continue;
            }
            
            if (!method.getReturnType().equals(void.class)) {
                continue;
            }

            Class< ? > []params = method.getParameterTypes();

            if (params.length == 1 && params[0].equals(arg)) {
                return method;
            }
        }
        return null;
    }
92678
public void set(double x1, double y1, double x2, double y2)
    {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }
717658
public static MethodInstance getSetter(Object obj, String prop, Object value) throws NoSuchMethodException {
	prop = "set" + StringUtil.ucFirst(prop);
	MethodInstance mi = getMethodInstance(obj, obj.getClass(), prop, new Object[] { value });
	Method m = mi.getMethod();

	if (m.getReturnType() != void.class)
	    throw new NoSuchMethodException("invalid return Type, method [" + m.getName() + "] must have return type void, now [" + m.getReturnType().getName() + "]");
	return mi;
    }
890815
void setu(String name, Object value) {
        try {
            set(name, value);
        } catch ( EvalError e ) {
            throw new InterpreterError("set: "+e, e);
        }
    }
601530
void init() {
        if (mEvaluator == null) {
            // We already handle int and float automatically, but not their Object
            // equivalents
            mEvaluator = (mValueType == Integer.class) ? sIntEvaluator :
                    (mValueType == Float.class) ? sFloatEvaluator :
                    null;
        }
        if (mEvaluator != null) {
            // KeyframeSet knows how to evaluate the common types - only give it a custom
            // evaluator if one has been set on this class
            mKeyframeSet.setEvaluator(mEvaluator);
        }
    }
633414
public void set( double x1, double y1, double z1,
					 double x2, double y2, double z2 ) {
		this.p1.set(x1,y1,z1);
		this.p2.set(x2,y2,z2);
	}
1139069
function(getterSetter, context, eventName) {
		this._set = context ? getterSetter.bind(context) : getterSetter;
		this._get = context ? getterSetter.bind(context) : getterSetter;
		this._canObserve = eventName === false ? false : true;
		// The helper provides the on and off methods that use `getValueAndBind`.
		var handlers = setupComputeHandlers(this, getterSetter, context || this);

		assign(this, handlers);
	}
1353840
Class<?> getSetterPropertyType( Clazz<?> clazz, String name )
	{
		ClassInfoCache cache = retrieveCache( clazz );
		Class<?> res = cache.getSetterType( name );
		if( res != null )
			return res;

		String setterName = "set" + capitalizeFirstLetter( name );
		Method setter = clazz.getMethod( setterName );
		if( setter != null && setter.getParameterTypes().size() == 1 )
		{
			res = setter.getParameterTypes().get( 0 );
		}
		else
		{
			Field field = clazz.getAllField( name );
			if( field != null )
				res = field.getType();
		}

		if( res != null )
			cache.setSetterType( name, res );

		return res;
	}
678142
public void set(Object object, Object value) throws IllegalAccessException, IllegalArgumentException {
        if (null != setter) {
            try {
                setter.invoke(object, value);
            } catch (InvocationTargetException ite) {
                if (ite.getCause() instanceof RuntimeException && !(ite.getCause() instanceof JTransfoException)) {
                    throw (RuntimeException) ite.getCause();
                }
                throw new JTransfoException(String.format(GET_SET_ITO, setter.getName(), object.getClass().getName(),
                        setter.getDeclaringClass().getName(), ite.getCause().getMessage()), ite.getCause());
            }
        } else {
            if (!setUsingFieldLogged) {
                log.warn("Cannot find setter (not public, wrong name or wrong type), "
                                + "using field to access field {} of {}.", name, field.getType().getName());
                setUsingFieldLogged = true;
            }
            field.set(object, value);
        }
    }