Check if `input` is a string and if so, either
refer to the global scope or `require` it. Then
call `loa` again in case the exported object
is a function.

@param {Mixed} input
@api private
2852
function str(input) {
  if (!is('String', input)) return;
  return root[input] || (root.require || require)(input);
}
1265029
function init(input) {
  // Use provided pool
  if(typeof input == 'function') db.pool = input;

  else {
    // Create the pool with any options merged with the below defaults
    db.pool = mysql.createPool(Object.assign({
      user: 'root',
      password: 'root',
      database: 'test'
    },input));
  }

  // Set the local _pool(just for convenience)
  _pool = db.pool;

  return db;
}
1218318
def scope=(input)
      @scope = (input.instance_of?(Redistat::Scope)) ? input : Scope.new(input)
    end
1000810
function validateInput(prop, ctx, validate) {
  debug('validating %s', prop);

  const request = ctx.request;
  const res = Joi.validate(request[prop], validate[prop]);

  if (res.error) {
    res.error.status = validate.failure;
    return res.error;
  }

  // update our request w/ the casted values
  switch (prop) {
    case 'header': // request.header is getter only, cannot set it
    case 'query': // setting request.query directly causes casting back to strings
      Object.keys(res.value).forEach((key) => {
        request[prop][key] = res.value[key];
      });
      break;
    case 'params':
      request.params = ctx.params = res.value;
      break;
    default:
      request[prop] = res.value;
  }
}
799070
function(input) {
			var self = this;
			if (!self.settings.create) return false;
			var filter = self.settings.createFilter;
			return input.length
				&& (typeof filter !== 'function' || filter.apply(self, [input]))
				&& (typeof filter !== 'string' || new RegExp(filter).test(input))
				&& (!(filter instanceof RegExp) || filter.test(input));
		}
1006012
function (input) {
    debug('requiredTextFilter(%s)', input);
    if (_.isString(input) && !_.isEmpty(input)) return input;
    if (_.isNumber(input)) return '' + input;
    return undefined;
  }
545750
function fixInputChange(input) {
    let files;
    Object.defineProperty(input, 'files', {
        set(v) { files = v; dispatchEvent(input, 'change'); },
        get(v) { return files }
    });
}
1234405
function standardizeInput(input) {
  if ([undefined, null].indexOf(input) !== -1) {
    input = null;
  }
  else if (_.isNaN(input)) {
    input = null;
  }
  else if (_.isString(input)) {
    input = input.trim();

    // Written empty values
    if (["unspecified", "unknown", "none", "null", "empty", ""].indexOf(input.toLowerCase()) !== -1) {
      input = null;
    }
  }

  return input;
}
423312
function type(input) {

  //If the input value is null, undefined or NaN the toStringTypes object shouldn't be used
  if (input === null || input === undefined || (input !== input && String(input) === "NaN")) {
    return String(input);
  }

  // use the typeMap to detect the type and fallback to object if the type wasn't found
  return typeMap[Object.prototype.toString.call(input)] || "object";
}
526957
function strToBool(input, defaultValue = false) {
  const value = String(input)
    .trim()
    .toLowerCase()
  if (['1', 'true', 'on', 'yes'].includes(value)) return true
  if (['0', 'false', 'off', 'no'].includes(value)) return false
  return defaultValue
}
911547
function (input) {
            if (typeof input !== 'undefined' && input !== null && input !== false) {
                master.emit('input', input, for_worker);
            } else {

                //No input? We might be done..

                var isComplete = function () {
                    //Check if any input was added dynamically
                    if (job.input.length > 0) {
                        job.is_complete = false;
                        return false;
                    }

                    //Wait for workers or instances that are still working
                    return worker_count > 0 ? areWorkersComplete() : job.instances <= 0;
                };

                //If we're not complete, check periodically
                if (isComplete()) {
                    master.emit('complete');
                } else {
                    completeCheckInterval = setInterval(function () {
                        if (isComplete()) {
                            clearInterval(completeCheckInterval);
                            master.emit('complete');
                        }
                    }, 300);
                }
            }
        }
638325
function (options) {
            if (!this.input) {
                return;
            }

            this.is_update = true;

            this.options.from = this.result.from;
            this.options.to = this.result.to;
            this.update_check.from = this.result.from;
            this.update_check.to = this.result.to;

            this.options = $.extend(this.options, options);
            this.validate();
            this.updateResult(options);

            this.toggleInput();
            this.remove();
            this.init(true);
        }
1373986
@Override
    public Object map(Object input) {
        if (condition.condition(input))
            return newValue;
        return input;

    }
1195519
function validate(inputs, options) {
    let hasError = false

    if (inputs.length >= 2) {
        console.error("ERROR: the input file should not be multiple.")
        hasError = true
    }
    if (inputs.length >= 1 && !fs.existsSync(inputs[0])) {
        console.error("ERROR: the input file should exist.")
        hasError = true
    }
    if (options.output != null && Array.isArray(options.output)) {
        console.error("ERROR: --output option should not be multiple.")
        hasError = true
    }
    if (inputs.length >= 1 && options.output != null && path.resolve(inputs[0]) === path.resolve(options.output)) {
        console.error("ERROR: --output option should not be the same as the input file.")
        hasError = true
    }
    if (options.manifest != null && Array.isArray(options.manifest)) {
        console.error("ERROR: --manifest option should not be multiple.")
        hasError = true
    }

    return !hasError
}
1206569
function(input) {
    return input.replace(/\{{2,}/g, function(match) {
      return match.length > 2 ? match.substr(2) : '<%=';
    }).replace(/\}{2,}/g, function(match) {
      return match.length > 2 ? match.substr(2) : '%>';
    });
  }
452664
@Override
    public boolean isValid(Object input) {
        int value;
        try {
            value = Integer.parseInt(input.toString());
        } catch (NumberFormatException e) {
            return false;
        }

        if (minAllowedValue != null && value < minAllowedValue)
            return false;
        if (maxAllowedValue != null && value > maxAllowedValue)
            return false;
        return true;
    }
1272356
function(input) {
    // Deny RETURN unless the command might work
    if (this.requisition.status !== Status.VALID) {
      return Promise.resolve(false);
    }

    this.terminal.history.add(input);
    this.terminal.unsetChoice().catch(util.errorHandler);

    this.terminal._previousValue = this.terminal.inputElement.value;
    this.terminal.inputElement.value = '';

    return this.requisition.exec().then(function() {
      this.textChanged();
      return true;
    }.bind(this));
  }