Set the stub logic.
13113
public function andRun()
    {
        if ($this->_returns) {
            throw new Exception("Some return value(s) has already been set.");
        }
        $closures = func_get_args();
        foreach ($closures as $closure) {
            if (!is_callable($closure)) {
                throw new Exception("The passed parameter is not callable.");
            }
        }
        $this->_closures = $closures;
    }
1070526
def set_context(self, context):
        """"""
        self._set_context(context, emit=False)
        self._modified = (not context.load_path)
        self.dataChanged.emit(self.CONTEXT_CHANGED |
                              self.REQUEST_CHANGED |
                              self.PACKAGES_PATH_CHANGED |
                              self.LOCKS_CHANGED |
                              self.LOADPATH_CHANGED |
                              self.PACKAGE_FILTER_CHANGED |
                              self.CACHING_CHANGED)
348590
def set_objective_sense(self, sense):
        """"""

        if sense not in (ObjectiveSense.Minimize, ObjectiveSense.Maximize):
            raise ValueError('Invalid objective sense')

        self._p.ModelSense = self.OBJ_SENSE_MAP[sense]
244810
def set(self, start, stop, length=None, units='bytes'):
        """"""
        assert is_byte_range_valid(start, stop, length), \
            'Bad range provided'
        self._units = units
        self._start = start
        self._stop = stop
        self._length = length
        if self.on_update is not None:
            self.on_update(self)
656031
def _prepare_if_args(stmt):
    """"""
    args = stmt['args']
    if args and args[0].startswith('(') and args[-1].endswith(')'):
        args[0] = args[0][1:].lstrip()
        args[-1] = args[-1][:-1].rstrip()
        start = int(not args[0])
        end = len(args) - int(not args[-1])
        args[:] = args[start:end]
361573
def setsockopt(self, *sockopts):
        """"""
        if type(sockopts[0]) in (list, tuple):
            for sock_opt in sockopts[0]:
                level, option, value = sock_opt
                self.connection.sockopts.add((level, option, value))
        else:
            level, option, value = sockopts
            self.connection.sockopts.add((level, option, value))
266103
void set(Instant effectiveFrom, T value) {
		T oldValue = get();
		values.put(effectiveFrom, value);
		notifyListeners(oldValue, value);
	}
1005992
function() {
        serviceFactory.optionalDeps = {}
        _.each(arguments, function(depName) {
          serviceFactory.optionalDeps[depName] = true
        })
      }
817188
def _init_datastore_v3_stub(self, **stub_kwargs):
        """"""
        task_args = dict(datastore_file=self._data_path)
        task_args.update(stub_kwargs)
        self.testbed.init_datastore_v3_stub(**task_args)
108999
protected final void setArguments(ByteBuffer bb, Object... args) {
    boolean wasFirst = true;
    for (Object o : args) {
      if (wasFirst) {
        wasFirst = false;
      } else {
        bb.put((byte) ' ');
      }
      bb.put(KeyUtil.getKeyBytes(String.valueOf(o)));
    }
    bb.put(CRLF);
  }
466166
protected function initTerra()
    {
        if (empty($this->mapSeed)) {
            $this->setMapSeed(microtime(true));
        }

        if (!$this->getPersistence()) {
            throw new LogicException('Persistence must be set');
        }

        if (!$this->getSize()) {
            throw new LogicException('Size must be set');
        }

        mt_srand($this->numericMapSeed * $this->persistence * $this->size);

        $this->terra = new SplFixedArray($this->size);
        for ($y = 0; $y < $this->size; $y++) {
            $this->terra[$y] = new SplFixedArray($this->size);
            for ($x = 0; $x < $this->size; $x++) {
                $this->terra[$y][$x] = 0;
            }
        }
    }
958313
private void setOptions(RuntimeConfiguration rc) {
        if (hasOption(SHORT_OPT_TIME)) {
            rc.setTime(true);
        }
        if (hasOption(LONG_OPT_DEBUG)) {
            rc.setDebug(true);
        }
        if (hasOption(LONG_OPT_VERBOSE)) {
            rc.setVerbose(true);
        }
        if (hasOption(LONG_OPT_PEDANTIC)) {
            rc.setWarningsAsErrors(true);
        }
    }
874023
public function setup(){
		if($this->hasOption('autoinit') && $this->options()->autoinit){
			if($this->hasOption('default')){
				$this->setValue($this->options()->default);
			}else{
				$this->setValue('now');
			}
		}
	}
787448
public function init()
    {
        parent::init(); // TODO: Change the autogenerated stub
        if (!$this->keepFileName) {
            $this->filename = $this->generateNewFilename();
        }
        if (empty($this->uploadDirectory)) {
            $this->uploadDirectory = Media::getCurrentDirectory();
        }
    }
389250
def set_option(self, key, value):
        """"""
        self._options.update(self._option_schema({key: value}))
        self.clear_cache()
511112
def _setse(self, i):
        """"""
        if i > 0:
            u = (i * 2) - 1
        else:
            u = -2 * i
        self._setue(u)
140229
def set(self, key, value):
        """"""
        if config.CACHE_POTENTIAL_PURVIEWS:
            self.cache[key] = value