Throw an error if neither a string or an interval provided
775097
function checkSearchTerm(searchTerm){
		if (!is_string(searchTerm) && !is_numeric(searchTerm)){
			console.log('\nError: This must be either a string or an interval:\n', searchTerm, ' \n');
			return false;
		} else {
			return true;
		}
	}
317743
def assert_not_in(obj, seq, message=None, extra=None):
    """"""
    # for very long strings, provide a truncated error
    if isinstance(seq, six.string_types) and obj in seq and len(seq) > 200:
        index = seq.find(obj)
        start_index = index - 50
        if start_index > 0:
            truncated = "(truncated) ..."
        else:
            truncated = ""
            start_index = 0
        end_index = index + len(obj) + 50
        truncated += seq[start_index:end_index]
        if end_index < len(seq):
            truncated += "... (truncated)"
        assert False, _assert_fail_message(message, obj, truncated, "is in", extra)
    assert obj not in seq, _assert_fail_message(message, obj, seq, "is in", extra)
996285
def blank?(str)
      str.nil? or (str.is_a? String and str.strip.empty?)
    end
532096
function silentHttpError(code, data, message, e) {
    var stack;

    if (Type.isObject(e)) {
        if (e && e.message) {
            message = message + ', ' + e.message;
        }
        stack = e.stack;
        e = null;
    } else if (Type.isString(e)) {
        stack = e;
    } else {
        e = new Error();
        stack = e.stack;
    }

    return toString('SlientHttpError', core.trace(8, 9), message, stack, core.inspect(data), code);
}
137930
def _wait_until_no_error_exp(self, timeout, wait_func, *args):
		""""""
	
		timeout = robot.utils.timestr_to_secs(timeout) if timeout is not None else self._timeout_in_secs
		maxtime = time.time() + timeout
		
		while True:
		
			try:
				timeout_error = wait_func(*args)
				if not timeout_error: return
				if time.time() > maxtime: raise AssertionError(timeout_error)
				time.sleep(0.2)
				
			except AssertionError:
			
				raise
				
			except:
			
				if time.time() > maxtime: raise
				continue
630924
def int_or_str(v: Optional[str]) -> Union[None, int, str]:
    """"""
    if v is None:
        return
    try:
        return int(v)
    except ValueError:
        return v
524558
def is_in_intervall(value, min_value, max_value, name='variable'):
    
    if not (min_value <= value <= max_value):
        raise ValueError('{}={} is not in [{}, {}]'
                         .format(name, value, min_value, max_value))
614179
def _fail(self, message, text, i):
        """"""

        raise ValueError("{}:\n{}".format(message, text[i : i + 79]))
493885
static void assertNotNull(String message, Object nonNullObject)
    {
        if(nonNullObject == null)
        {
            System.err.println(message);
        }
    }
699915
def __error_callback(self, exception, interval):
        
        logging.error('Error while publishing {}'.format(
            exception))
        logging.info('Retry in %s seconds.', interval)
645970
def coerce(cls, arg):
        """"""
        try:
            return cls(arg).value
        except (ValueError, TypeError):
            raise InvalidParameterDatatype("%s coerce error" % (cls.__name__,))
526621
def run(self, value, errors, request):
        """"""
        value = self.id_validator(value, errors, request)
        if errors:
            return None
        if self.fetch_by:
            thing = self.cls.fetch_by(**{self.fetch_by: value})
        else:
            thing = self.cls.fetch_by_id(value)
        if not thing and self.source == SOURCE_MATCHDICT:
            # If part of the URL we should have a not-found error
            raise HTTPNotFound()
        elif not thing:
            self.add_error(errors, 'Invalid {0}'
                           .format(self.cls.__name__))
        return thing
250928
function(content) {
                // Convert bad values into empty strings
                var isInvalid = content === null || content === undefined || isNaN(content) && '' + content === 'NaN';
                return '' + (isInvalid ? '' : content);
            }
492172
def is_valid_interval(interval):
    
    if not isinstance(interval, (int, long)):
        return False

    if interval <= 0:
        return False

    return True
656525
def try_and_error(*funcs):
    """"""
    def validate(value):
        exc = None
        for func in funcs:
            try:
                return func(value)
            except (ValueError, TypeError) as e:
                exc = e
        raise exc
    return validate
806475
def validate_lineplot(value):
    """"""
    if value is None:
        return value
    elif isinstance(value, six.string_types):
        return six.text_type(value)
    else:
        value = list(value)
        for i, v in enumerate(value):
            if v is None:
                pass
            elif isinstance(v, six.string_types):
                value[i] = six.text_type(v)
            else:
                raise ValueError('Expected None or string, found %s' % (v, ))
    return value
511470
function onError(reason, commands) {
        if (typeof reason !== 'string' && typeof reason.message === 'string') {
            reason = reason.message;
        }
        return commands._replyFn(`An unexpected error \`${reason}\` occured and your commands could not be processed!`);
    }