Set a substitute return value for a method. Whenever this method will be
called the {@code value} will be returned instead.

@return The previous substitute value if any.
320798
public static synchronized Object putMethodToStub(Method method, Object value) {
		return substituteReturnValues.put(method, value);
	}
1035352
def value
      val = self.lazy_proc?(@value) ? self.coerce(@value.call) : @value
      val.respond_to?(:returned_value) ? val.returned_value : val
    end
1082179
public void returnValue(Local<?> result) {
        if (!result.type.equals(method.returnType)) {
            // TODO: this is probably too strict.
            throw new IllegalArgumentException("declared " + method.returnType
                    + " but returned " + result.type);
        }
        addInstruction(new PlainInsn(Rops.opReturn(result.type.ropType), sourcePosition,
                null, RegisterSpecList.make(result.spec())));
    }
1115272
def substitute(self, values={}, functions={}):
        
        try:
            res = self.compiled(values, functions)
        except Exception:  # Handle any exceptions thrown by compiled version.
            res = self.interpret(values, functions)

        return res
1365421
@Override
    public boolean getValue() throws OntopConnectionException {
        if (hasRead)
            throw new IllegalStateException("getValue() can only called once!");
        hasRead = true;
        try {
            return set.next();
        } catch (SQLException e) {
            throw new OntopConnectionException(e);
        }
    }
1296633
function() {
            var selector = this.options.valueSelector;
            if (_.isFunction(selector)) {
                this.value = selector(this);
            } else if (_.isString(selector)) {
                this.value = this[selector]();
            } else {
                this.value = selector;
            }
            return this.value;
        }
896416
def setValue(self, value):
        
        if isinstance(value, Text):
            self.value = value
        else:
            self.value = Text(value)
        return self
103841
@Deprecated
  @Nullable
  public V get() {
    V value = pop();
    if (value != null) {
      mInUseLength++;
    }
    return value;
  }
587281
def set(self, value):
        '''
        
        '''
        with self._reference.get_lock():
            self._reference.value = value
            return value
567004
public java.lang.String getNewValue() {
    java.lang.Object ref = newValue_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      newValue_ = s;
      return s;
    }
  }
892472
public Option defaultValue(String defaultValue) throws RequiredParametersException {
		if (this.choices.isEmpty()) {
			return this.setDefaultValue(defaultValue);
		} else {
			if (this.choices.contains(defaultValue)) {
				return this.setDefaultValue(defaultValue);
			} else {
				throw new RequiredParametersException("Default value " + defaultValue +
						" is not in the list of valid values for option " + this.longName);
			}
		}
	}
794824
public double getSolution(double targetValue, double initGuess) {
    double rMax = 1.0;
    double oldValue = -1;
    for (int i = 0; i < MAXIMUM_ITERATION; ++i) {
      double value = targetFunction(rMax);
      if (value >= targetValue) {
        break;
      }
      if (equals(value, oldValue)) {
        return rMax; // Target value is not feasible. Just return rMax
      }
      rMax *= 2;
    }
    double left = 0;
    double right = rMax;
    double mid = initGuess > left && initGuess < right ?
        initGuess : (left + right) / 2.0;
    for (int i = 0; i < MAXIMUM_ITERATION; ++i) {
      double value = targetFunction(mid);
      if (equals(value, targetValue)) {
        return mid;
      }
      if (value < targetValue) {
        left = mid;
      } else {
        right = mid;
      }
      mid = (left + right) / 2.0;
    }
    return right;
  }
974425
public static Prefer valueOf(final String value) {
        if (value != null) {
            final Map<String, String> data = new HashMap<>();
            final Set<String> params = new HashSet<>();
            stream(value.split(";")).map(String::trim).map(pref -> pref.split("=", 2)).forEach(x -> {
                if (x.length == 2) {
                    data.put(x[0].trim(), x[1].trim());
                } else {
                    params.add(x[0].trim());
                }
            });
            return new Prefer(data.get(PREFER_RETURN), parseParameter(data.get(PREFER_INCLUDE)),
                        parseParameter(data.get(PREFER_OMIT)), params, data.get(PREFER_HANDLING));
        }
        return null;
    }
135695
public Object setValue(final Object value) {
        final Object answer = this.value;
        this.value = value;
        return answer;
    }
432665
public V setValue (V value)
    {
        V oldValue = _value;
        _value = value;
        return oldValue;
    }
382738
@CanIgnoreReturnValue // TODO(kak): Consider removing this?
  @Nullable
  public static <T> T getOnlyElement(Iterator<? extends T> iterator, @Nullable T defaultValue) {
    return iterator.hasNext() ? getOnlyElement(iterator) : defaultValue;
  }
7873
protected Object getValue(SetterMethodCover method, Variable variable) {
        if(method.isTwoDimensionsArray()) 
            return assignValuesToTwoDimensionsArray(method, variable.getSFSArrayValue());
        if(method.isArray())
            return assignValuesToArray(method, variable);
        
        if(method.isColection())
            return assignValuesToCollection(method, variable);

        if(method.isObject())
            return assignValuesToObject(method, variable.getSFSObjectValue());
        if(method.isByte())
            return variable.getIntValue().byteValue();
        if(method.isChar())
            return (char)variable.getIntValue().byteValue();
        if(method.isFloat())
            return variable.getDoubleValue().floatValue();
        if(method.isLong())
            return variable.getDoubleValue().longValue();
        if(method.isShort())
            return variable.getIntValue().shortValue();
        return variable.getValue();
    }