type - {string} The type of operation to set the timeout for. Valid values are: "script" for
script timeouts, "implicit" for modifying the implicit wait timeout and "page load" for setting
a page load timeout.
358846
@Override
  public Response handle() throws Exception {
    JSONObject payload = getRequest().getPayload();
    String type = payload.optString("type");
    if ("page load".equals(type)) {
      long timeout = payload.getLong("ms");
      // meant for driver.get command
      CommandConfiguration conf = getSession().configure(WebDriverLikeCommand.URL);
      conf.set("page load", timeout);
    } else {
      throw new UnsupportedCommandException("timeout " + payload + " NI");
    }
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(new JSONObject());
    return res;
  }
343442
function type(value) {
  let valueType = typeof value;
  if (Array.isArray(value)) {
    valueType = 'array';
  } else if (value instanceof Date) {
    valueType = 'date';
  } else if (value === null) {
    valueType = 'null';
  }

  return valueType;
}
880459
function __typeCheck(type, valueToCheck, optional) {
    var correct = typeof(valueToCheck) == type;
    if(optional) {
        // Exception if the variable is optional, than it also may be undefined or null
        correct = correct || valueToCheck === undefined || valueToCheck === null;
    }
    if(!correct) {
        throw new Error("Invalid argument type received; expected "+type+
            ", but received "+typeof(valueToCheck));
    }
}
162984
private void parseReadTimeout(Map<Object, Object> props) {
        Object value = props.get(HttpConfigConstants.PROPNAME_READ_TIMEOUT);
        if (null != value) {
            try {
                this.readTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger(value), HttpConfigConstants.MIN_TIMEOUT);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Read timeout is " + getReadTimeout());
                }
            } catch (NumberFormatException nfe) {
                FFDCFilter.processException(nfe, getClass().getName() + ".parseReadTimeout", "1");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Invalid read timeout; " + value);
                }
            }
        }
    }
2902
public void setScriptWait(int scriptTimeout) {
        try {
            driver().manage().timeouts().setScriptTimeout(scriptTimeout, TimeUnit.MILLISECONDS);
        } catch (Exception e) {
            // https://code.google.com/p/selenium/issues/detail?id=6015
            System.err.println("Unable to set script timeout (known issue for Safari): " + e.getMessage());
        }
    }
60667
function setPrefixTimeout(element) {
  resetPrefixTimeout(element);
  element[prefixTimeoutKey] = setTimeout(() => {
    resetTypedPrefix(element);
  }, TYPING_TIMEOUT_DURATION);
}
737374
function typeOf (value) {
  var type = {
    hasValue: false,
    isArray: false,
    isPOJO: false,
    isNumber: false,
  };

  if (value !== undefined && value !== null) {
    type.hasValue = true;
    var typeName = typeof value;

    if (typeName === 'number') {
      type.isNumber = !isNaN(value);
    }
    else if (Array.isArray(value)) {
      type.isArray = true;
    }
    else {
      type.isPOJO =
        (typeName === 'object') &&
        !(value instanceof RegExp) &&
        !(value instanceof Date);
    }
  }

  return type;
}
1163629
function(type){
            type = this.string(type);
            if(types.indexOf(type.toLowerCase()) < 0){
                throw new TypeError('a type in [' + types.join(', ') + '] is expected, but ' + type + ' given');
            }
            return type.toLowerCase();
        }
44074
function(type) {

	var items = _.filter(process.env, function(value, key) {

		var pattern = new RegExp('CORS\_ALLOWED\_' + type.toUpperCase(), 'i')

		return key.match(pattern);

	});

	return items.join(', ') || '*';

}
1337850
function validateTextOperationJSON (op) {
  debug('validateTextOperationJSON %o', op)
  assertErr(Array.isArray(op), Error, 'operation must be an array', { op: op })
  assertErr(op.length, Error, 'operation cannot be empty', { op: op })
  var type
  var lastType = ''
  op.forEach(function (item) {
    if (typeof item === 'string') {
      // valid
      type = 'string'
      assertErr(lastType !== type, Error, 'invalid operation: cannot have repeating ' + type + 's')
      lastType = type
      return
    } else if (typeof item === 'number') {
      var isIntegerOrZero = (item === (item | 0))
      assertErr(isIntegerOrZero, Error, 'invalid operation: numbers must be integers')
      type = item === 0
        ? 'zero'
        : item > 0
          ? 'positive integer'
          : 'negative integer'
      assertErr(lastType !== type, Error, 'invalid operation: cannot have repeating ' + type + 's')
      lastType = type
    } else {
      throw new Error('invalid operation: must be an array of strings and numbers')
    }
  })
}
354823
def type(self, type):
        
        if type is None:
            raise ValueError("Invalid value for `type`, must not be `None`")
        if type is not None and len(type) > 50:
            raise ValueError("Invalid value for `type`, length must be less than or equal to `50`")
        if type is not None and not re.search('[\\x21-\\x7E \\t]*', type):
            raise ValueError("Invalid value for `type`, must be a follow pattern or equal to `/[\\x21-\\x7E \\t]*/`")

        self._type = type
1174304
function typeOf(value) {
  var returned = Object.prototype.toString.call(value);
  return returned.substring(1, returned.length - 1).split(' ')[1].toLowerCase();
}
52544
private void parsePersistTimeout(Map<Object, Object> props) {
        Object value = props.get(HttpConfigConstants.PROPNAME_PERSIST_TIMEOUT);
        if (null != value) {
            try {
                this.persistTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger(value), HttpConfigConstants.MIN_TIMEOUT);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Persist timeout is " + getPersistTimeout());
                }
            } catch (NumberFormatException nfe) {
                FFDCFilter.processException(nfe, getClass().getName() + ".parsePersistTimeout", "1");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Invalid persist timeout; " + value);
                }
            }
        }
    }
650002
function _startTimeout(o, t) {
        _timeout[o.id] = w.setTimeout(function() { _ioCancel(o, 'timeout'); }, t);
    }
477900
function validateResponseType (type) {
  if (validTypes.indexOf(type) < 0)
    return option.some(`Response content type ${type} is not supported`)
  return option.none
}
730728
def set_page_load_timeout(self, time_to_wait):
        
        try:
            self.execute(Command.SET_TIMEOUTS, {
                'pageLoad': int(float(time_to_wait) * 1000)})
        except WebDriverException:
            self.execute(Command.SET_TIMEOUTS, {
                'ms': float(time_to_wait) * 1000,
                'type': 'page load'})
1252305
function getType(variable) {
        var types = {
            'undefined': 'undefined',
            'number': 'number',
            'boolean': 'boolean',
            'string': 'string',
            '[object Function]': 'function',
            '[object RegExp]': 'regexp',
            '[object Array]': 'array',
            '[object Date]': 'date',
            '[object Error]': 'error'
        };

        return types[typeof variable === 'undefined' ? 'undefined' : _typeof(variable)] || types[{}.toString.call(variable)] || (variable ? 'object' : 'null');
    }