Set integer runtime value with re-authenticate if needed
483954
def set_runtime_value_int(self, ihcid: int, value: int) -> bool:
        
        if self.client.set_runtime_value_int(ihcid, value):
            return True
        self.re_authenticate()
        return self.client.set_runtime_value_int(ihcid, value)
657466
def set_number(self, key, value):
        
        storage = self.storage

        if not isinstance(value, int):
            logger.error("set_number: Value must be an integer")
            return

        try:
            lock.acquire()
            storage[key] = value
        finally:
            self.storage._p_changed = True
            lock.release()

        return storage[key]
1120813
def set_(key,
         value,
         host=DEFAULT_HOST,
         port=DEFAULT_PORT,
         time=DEFAULT_TIME,
         min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
    '''
    
    '''
    if not isinstance(time, six.integer_types):
        raise SaltInvocationError('\'time\' must be an integer')
    if not isinstance(min_compress_len, six.integer_types):
        raise SaltInvocationError('\'min_compress_len\' must be an integer')
    conn = _connect(host, port)
    _check_stats(conn)
    return conn.set(key, value, time, min_compress_len)
89090
def set(self, key, value):
        """"""
        key = "{0}{1}".format(self.prefix, key)

        value = json.dumps(value, cls=NumpyEncoder)
        self.redis.set(key, value)
1251145
function encodeInteger(value) {
	if (value === null) {
		return values.NULL;
	} else if (!isNaN(value) && parseInt(value)==value) {
		return value + "";
	} else {
		throw new Error('Invalid integer value "' + value + '"');
	}
}
235072
void set_write_value(Any any) throws DevFailed
	{
		switch (data_type)
		{
		case Tango_DEV_STATE :
			// Check data type inside the any
			DevState[] st = null;
			try
			{
				st = DevVarStateArrayHelper.extract(any);
			}
			catch (BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevBoolean",
						       "WAttribute.set_write_value()");
			}
		
			//	No min max value check for boolean !
			state_val = st[0];
			break;
		
		case Tango_DEV_BOOLEAN :
			// Check data type inside the any
			boolean[] bl_ptr = null;
			try
			{
				bl_ptr = DevVarBooleanArrayHelper.extract(any);
			}
			catch (BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevBoolean",
						       "WAttribute.set_write_value()");
			}
		
			//	No min max value check for boolean !
			old_bool_val = bool_val;		
			bool_val = bl_ptr[0];
			break;
		
		case Tango_DEV_SHORT :
			// Check data type inside the any
			short[] sh_ptr = null;
			try
			{
				sh_ptr = DevVarShortArrayHelper.extract(any);
			}
			catch (BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevShort",
						       "WAttribute.set_write_value()");
			}
		
			// Check the incoming value
			if (check_min_value == true)
			{
				if (sh_ptr[0] <= min_value.sh)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",
							       o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (sh_ptr[0] >= max_value.sh)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",
							       o.toString(),
							       "WAttribute.set_write_value()");
				}
			}

			old_short_val = short_val;		
			short_val = sh_ptr[0];
			break;
		

		case Tango_DEV_USHORT :
			// Check data type inside the any
			short[] ush_ptr = null;
			try
			{
				ush_ptr = DevVarUShortArrayHelper.extract(any);
			}
			catch (BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevUShort",
						       "WAttribute.set_write_value()");
			}
		
			// Check the incoming value
			int	ush_val =  (0xFFFF & ush_ptr[0]);
			if (check_min_value == true)
			{
				if (ush_val <= min_value.sh)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",
							       o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (ush_val >= max_value.sh)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",
							       o.toString(),
							       "WAttribute.set_write_value()");
				}
			}

			old_long_val = long_val;				
			long_val = ush_val;
			break;
		

		case Tango_DEV_LONG :
			// Check data type inside the any
			int[] lg_ptr = null;
			try
			{
				lg_ptr = DevVarLongArrayHelper.extract(any);
			}
			catch(BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevLong",
						       "WAttribute.set_write_value()");
			}
			// Check the incoming value
			if (check_min_value == true)
			{
				if (lg_ptr[0] <= min_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (lg_ptr[0] >= max_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}

			old_long_val = long_val;				
			long_val = lg_ptr[0];
			break;


		case Tango_DEV_ULONG :
			// Check data type inside the any
			int[] ulg_ptr = null;
			try
			{
				ulg_ptr = DevVarULongArrayHelper.extract(any);
			}
			catch(BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevULong",
						       "WAttribute.set_write_value()");
			}
			// Check the incoming value
			long	mask = (long) 0x7fffffff;
			mask += ((long)1 << 31);
			long	ulg_val =  (mask & (long)ulg_ptr[0]);
			if (check_min_value == true)
			{
				if (ulg_val <= min_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (ulg_val >= max_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}

			old_long64_val = long64_val;				
			long64_val = ulg_val;
			break;


		case Tango_DEV_LONG64 :
			// Check data type inside the any
			long[] lg64_ptr = null;
			try
			{
				lg64_ptr = DevVarLong64ArrayHelper.extract(any);
			}
			catch(BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevLong",
						       "WAttribute.set_write_value()");
			}
			// Check the incoming value
			if (check_min_value == true)
			{
				if (lg64_ptr[0] <= min_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (lg64_ptr[0] >= max_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}

			old_long64_val = long64_val;				
			long64_val = lg64_ptr[0];
			break;


		case Tango_DEV_ULONG64 :
			// Check data type inside the any
			long[] ulg64_ptr = null;
			try
			{
				ulg64_ptr = DevVarLong64ArrayHelper.extract(any);
			}
			catch(BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevLong",
						       "WAttribute.set_write_value()");
			}
			// Check the incoming value
			if (check_min_value == true)
			{
				if (ulg64_ptr[0] <= min_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (ulg64_ptr[0] >= max_value.lg)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}

			old_long64_val = long64_val;				
			long64_val = ulg64_ptr[0];
			break;

		
		case Tango_DEV_DOUBLE :
			// Check data type inside the any
			double[] db_ptr = null;
			try
			{
				db_ptr = DevVarDoubleArrayHelper.extract(any);
			}
			catch(BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevDouble",
						       "WAttribute.set_write_value()");
			}
		
			// Check the incoming value
			if (check_min_value == true)
			{
				if (db_ptr[0] <= min_value.db)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is below the minimum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}
			if (check_max_value == true)
			{
				if (db_ptr[0] >= max_value.db)
				{
					StringBuffer o = new StringBuffer("Set value for attribute ");
					o.append(name);
					o.append(" is above the maximum authorized");
					Except.throw_exception("API_WAttrOutsideLimit",o.toString(),
							       "WAttribute.set_write_value()");
				}
			}		

			old_double_val = double_val;
			double_val = db_ptr[0];
			break;
		

		case Tango_DEV_STRING :
			String[] str_ptr = null;
			try
			{
				str_ptr = DevVarStringArrayHelper.extract(any);
			}
			catch(BAD_OPERATION ex)
			{
				Except.throw_exception("API_IncompatibleAttrDataType",
						       "Incompatible attribute type, expected type is : Tango_DevString",
						       "WAttribute.set_write_value()");
			}

			old_str_val = str_val;
			str_val = str_ptr[0];
			break;
		}
	}
543945
private static void ensureNumber(Object value) throws ExecutionException {

        if (!isNumber(value)) {
            String message = value.getClass().getCanonicalName() + " can not cast to a Number.";
            LOGGER.error(message);
            throw new ExecutionException(message);
        }
    }
841964
function() {
                    if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
                        _loopID = COMPATIBILITY.rAF()(function () {
                            loop();
                        });
                        var timeNew = COMPATIBILITY.now();
                        var timeDelta = timeNew - _loopTimeOld;
                        var lowestInterval;
                        var instance;
                        var instanceOptions;
                        var instanceAutoUpdateAllowed;
                        var instanceAutoUpdateInterval;
                        var now;

                        if (timeDelta > _loopInterval) {
                            _loopTimeOld = timeNew - (timeDelta % _loopInterval);
                            lowestInterval = _loopIntervalDefault;
                            for(var i = 0; i < _loopingInstances[_strLength]; i++) {
                                instance = _loopingInstances[i];
                                if (instance !== undefined) {
                                    instanceOptions = instance.options();
                                    instanceAutoUpdateAllowed = instanceOptions[_strAutoUpdate];
                                    instanceAutoUpdateInterval = MATH.max(1, instanceOptions[_strAutoUpdateInterval]);
                                    now = COMPATIBILITY.now();

                                    if ((instanceAutoUpdateAllowed === true || instanceAutoUpdateAllowed === null) && (now - _loopingInstancesIntervalCache[i]) > instanceAutoUpdateInterval) {
                                        instance.update('auto');
                                        _loopingInstancesIntervalCache[i] = new Date(now += instanceAutoUpdateInterval);
                                    }

                                    lowestInterval = MATH.max(1, MATH.min(lowestInterval, instanceAutoUpdateInterval));
                                }
                            }
                            _loopInterval = lowestInterval;
                        }
                    } else {
                        _loopInterval = _loopIntervalDefault;
                    }
                }
1005879
public void bind(IntegerProperty property, String key) {
		if (prefs.get(validateKey(key), null) != null) {
			property.set(prefs.getInt(key, Integer.MIN_VALUE));
		}
		property.addListener(o -> prefs.putInt(key, property.getValue()));
	}
955887
@Override
	public int getInt(String fldName) throws RemoteException {
		try {
			fldName = fldName.toLowerCase(); // to ensure case-insensitivity
			return (Integer) s.getVal(fldName).castTo(INTEGER).asJavaVal();
		} catch (RuntimeException e) {
			rconn.rollback();
			throw e;
		}
	}
958178
def set(self, key, value, *, expire=0, pexpire=0, exist=None):
        
        if expire and not isinstance(expire, int):
            raise TypeError("expire argument must be int")
        if pexpire and not isinstance(pexpire, int):
            raise TypeError("pexpire argument must be int")

        args = []
        if expire:
            args[:] = [b'EX', expire]
        if pexpire:
            args[:] = [b'PX', pexpire]

        if exist is self.SET_IF_EXIST:
            args.append(b'XX')
        elif exist is self.SET_IF_NOT_EXIST:
            args.append(b'NX')
        fut = self.execute(b'SET', key, value, *args)
        return wait_ok(fut)
676213
def user(val, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    if not isinstance(val, six.integer_types):
        # Try to convert to integer. This will fail if the value is a
        # username. This is OK, as we check below to make sure that the
        # value is either a string or integer. Trying to convert to an
        # integer first though will allow us to catch the edge case in
        # which a quoted uid is passed (e.g. '1000').
        try:
            val = int(val)
        except (TypeError, ValueError):
            pass
    if not isinstance(val, (six.integer_types, six.string_types)):
        raise SaltInvocationError('Value must be a username or uid')
    elif isinstance(val, six.integer_types) and val < 0:
        raise SaltInvocationError('\'{0}\' is an invalid uid'.format(val))
    return val
618787
public void postProgrammaticAuthenticate(final HttpServletRequest req, final HttpServletResponse resp, final AuthenticationResult authResult,
                                             final boolean alwaysSetCallerSubject, final boolean addSSOCookie) {
        if (System.getSecurityManager() == null) {
            setSubjectAndCookies(req, resp, authResult, alwaysSetCallerSubject, addSSOCookie);
        } else {
            AccessController.doPrivileged(new PrivilegedAction<Object>() {

                @Override
                public Object run() {
                    setSubjectAndCookies(req, resp, authResult, alwaysSetCallerSubject, addSSOCookie);
                    return null;
                }
            });
        }
    }
900952
def authenticationReject():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x11)  # 00010001
    packet = a / b
    return packet
509280
def as_int(value, default = 0)
      res = default

      if value
        if value.is_a?(Fixnum)
          res = value
        elsif value.respond_to?(:to_i)
          res = value.to_i
        end
      end

      res
    end
650983
def ttl_for_access_token=(seconds)
      raise_if_authentication_failed!

      key = @key_for_access_token
      value = @value_for_access_token
      ApiWarden.redis { |conn| conn.set(key, value, ex: seconds) }
    end
1282063
def set_integer(self, option, value):
        
        try:
            int_value = int(value)
        except ValueError as err:
            print(err.args)

        self.options[option] = value