isYear returns true if string s is a valid
Year number.  Must be 2 or 4 digits only.

For Year 2000 compliance, you are advised
to use 4-digit year numbers everywhere.
548558
public static boolean isYear(String s) {
        if (isEmpty(s)) return defaultEmptyOK;

        if (!isNonnegativeInteger(s)) return false;
        return ((s.length() == 2) || (s.length() == 4));
    }
494333
private static boolean isAsciiAlphaNum(String string) {
        for (int i = 0; i < string.length(); i++) {
            final char character = string.charAt(i);
            if (!(character >= 'a' && character <= 'z' ||
                    character >= 'A' && character <= 'Z' ||
                    character >= '0' && character <= '9')) {
                return false;
            }
        }

        return true;
    }
720103
public boolean isNumber() {
        return ( this.simpleType == SimpleValueType.INTEGER ||
                 this.simpleType == SimpleValueType.DECIMAL ||
                 this.simpleType == SimpleValueType.CHAR || 
                 this.simpleType == SimpleValueType.NUMBER ) ;
    }
365859
public static boolean isNumeric(String in) {
		char c = 0;
		for (int i = in.length(); i > 0; i--) {
			c = in.charAt(i - 1);
			if (!Character.isDigit(c)) {
				return false;
			}
		}
		return true;
	}
1236553
def is_str(string):
    
    if sys.version_info[:2] >= (3, 0):
        return isinstance(string, str)

    return isinstance(string, basestring)
1214258
def years_match(data, years):
    
    years = [years] if isinstance(years, int) else years
    dt = datetime.datetime
    if isinstance(years, dt) or isinstance(years[0], dt):
        error_msg = "`year` can only be filtered with ints or lists of ints"
        raise TypeError(error_msg)
    return data.isin(years)
716238
@FFDCIgnore(NumberFormatException.class)
    private boolean isSuccessStatusCode(String s) {
        if (s == null) {
            return false;
        }
        if ("2XX".equals(s) || "default".equals(s)) {
            return true;
        }
        if (s.length() != 3) {
            return false;
        }
        try {
            final int i = Integer.parseInt(s);
            return i >= 200 && i <= 299;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }
703944
def isValidSemver(version):
    """"""
    if version and isinstance(version, string_types):
        try:
            semver.parse(version)
        except (TypeError,ValueError):
            return False
        else:
            return True
    return False
1275588
private boolean validFormat(final String s) {
        String[] args = ARGS_REGEX.split(s);
        if (noItems(args)) return false;
        if (args.length < 3) return false;

        // Check for the presence of a function name
        String name = args[0];
        if (name.isEmpty()) return false;
        if (!validFunction(name)) return false;

        // Check for the presence of a return type
        String returntype = args[args.length - 1];
        if (returntype.isEmpty()) return false;
        if (!validReturnType(returntype)) return false;

        // Check for zero or more arguments
        String arglist = args[1];
        if (arglist.isEmpty()) return true;

        // Split parameters on comma
        String[] argsplit = arglist.split(",");
        for (final String arg : argsplit) {
            if (!validParameter(arg)) return false;
        }
        return true;
    }
1208360
public boolean isNumber(Object value) {

        if(value == null) {
            return false;
        }

        if(value instanceof Number) {
            return true;
        }

        // valid Long?
        if(String.valueOf(value).matches("\\d+")) {
            return true;
        }

        try {
            // valid Double?
            Double.parseDouble(String.valueOf(value));
        } catch(Exception e) {
            return false;
        }

        return true;
    }
235466
public static boolean isNumberStr(String arg) {
        if (StringUtils.isEmpty(arg)) {
            return false;
        }
        return check(arg, NUMBER_STR_PARTER);
    }
734804
function isNumberString(value) {
    let numberReg = /^((-?\d*\.?\d*(?:e[+-]?\d*(?:\d?\.?|\.?\d?)\d*)?)|(0[0-7]+)|(0x[0-9a-f]+))$/i;
    return lodash.isString(value) && !isEmpty(value) && numberReg.test(value);
}
316842
public boolean isValidNamedVersion(final String s) {
    if (SEMANTIC_RANGE_SPECIAL_CHARS.matcher(s).find()
        || SET_RANGE_SPECIAL_CHARS.matcher(s).find()
        || INVALID_VERSION_CHARS.matcher(s).find()
        ) {
      return false;
    }
    return true;
  }
1214109
public static function isLeapYear($year = null): bool
    {
        $year = $year ? $year : date('Y');
        return ($year % 4 == 0 && $year % 100 != 0 || $year % 400 == 0);
    }
1096208
public static boolean isAlphanumeric(String s) {
        if (isEmpty(s)) return defaultEmptyOK;

        // Search through string's characters one by one
        // until we find a non-alphanumeric character.
        // When we do, return false; if we don't, return true.
        for (int i = 0; i < s.length(); i++) {
            // Check that current character is number or letter.
            char c = s.charAt(i);

            if (!isLetterOrDigit(c)) return false;
        }

        // All characters are numbers or letters.
        return true;
    }
108236
boolean isValid(
        int cycle,
        int yearOfCycle,
        EastAsianMonth month,
        int dayOfMonth
    ) {
        if (
            (cycle < 72) || (cycle > 94)
            || (yearOfCycle < 1) || (yearOfCycle > 60)
            || ((cycle == 72) && (yearOfCycle < 22))
            || ((cycle == 94) && (yearOfCycle > 56))
            || (dayOfMonth < 1) || (dayOfMonth > 30)
            || (month == null)
            || (month.isLeap() && (month.getNumber() != this.getLeapMonth(cycle, yearOfCycle)))
        ) {
            return false;
        } else if (dayOfMonth == 30) { // the only case when astronomical validation is required
            long monthStart = this.firstDayOfMonth(cycle, yearOfCycle, month);
            long nextNewMoon = this.newMoonOnOrAfter(monthStart + 1);
            return (nextNewMoon - monthStart == 30);
        }

        return true;
    }
214369
def valid_entry?(key, year)
      datestr = fetched key
      return false unless datestr
      date = Date.parse datestr
      year || Date.today - date < 60
    end