Return true if the string is a mathematical symbol.
435962
def is_symbol(string):
    
    return (
        is_int(string) or is_float(string) or
        is_constant(string) or is_unary(string) or
        is_binary(string) or
        (string == '(') or (string == ')')
    )
1253114
public static boolean isDigitsOnly(String s) {
        if (isEmpty(s)) return false;
        String rslt = s.trim();
        if (isEmpty(rslt)) return false;
        for (int i = 0; i < rslt.length(); i++) {
            char ch = rslt.charAt(i);
            if (!Character.isDigit(ch)) return false;
        }
        return true;
    }
306358
def ns(symbol):
        ''''''
        if symbol.type and symbol.type.is_primitive:
            return ''
        return '{0}::'.format('::'.join(symbol.module.name_parts))
997655
private boolean isToken(String value) {
        int len = value.length();
        for (int i = 0; i < len; i++) {
            char c = value.charAt(i);
            if (c < 0x20 || c >= 0x7f || TSPECIALS.indexOf(c) != -1) {
                return false;
            }
        }

        return true;
    }
492871
def validates_to_be_string_or_symbol!(value)
      case
      when value.nil?, value == "", value == :""
        raise ArgumentError, "#{value} is empty string or symbol"
      when !value.is_a?(String) && !value.is_a?(Symbol)
        raise ArgumentError, "#{value} is not string or symbol"
      else
        true
      end
    end
860568
public static boolean isTokenSymbol(char c) {
        return (c == BEAN_SYMBOL
                || c == TEMPLATE_SYMBOL
                || c == PARAMETER_SYMBOL
                || c == ATTRIBUTE_SYMBOL
                || c == PROPERTY_SYMBOL);
    }
862639
public boolean containsSymbol(String symbol) {

        // search for identical symbol
        int bucket = hash(symbol) % fTableSize;
        int length = symbol.length();
        OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
            if (length == entry.characters.length) {
                for (int i = 0; i < length; i++) {
                    if (symbol.charAt(i) != entry.characters[i]) {
                        continue OUTER;
                    }
                }
                return true;
            }
        }

        return false;

    }
306308
public static boolean isNumeric(String string, boolean bAllowFormatting)
    {
        if ((string == null) || (string.length() == 0))
            return false;
        boolean bIsNumeric = true;
        for (int i = 0; i < string.length(); i++)
        {
            if (!Character.isDigit(string.charAt(i)))
            {
            	if ((!bAllowFormatting)
            		|| (Character.isLetter(string.charAt(i))))
            			bIsNumeric = false;
            }
        }
        return bIsNumeric;
    }
1294806
static boolean isSymbol(Object obj) {
        return (((obj instanceof NativeSymbol) &&
                ((NativeSymbol)obj).isSymbol())) || (obj instanceof SymbolKey);
    }
397440
function(s){
        if (s.substr(0, 2) === '02' || s.substr(0, 2) === '03' || s.substr(0, 2) === '04' || s.substr(0, 2) === '07' || s.substr(0, 2) === '08') return true;
        return (s.substr(0, 2) === '61') || (s.substr(0, 4) === '0061');
    }
637734
private boolean isInt(String str) {
        try {
            Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }
257338
public static boolean isAllNumber(String str) {
    	boolean hasNumber = false;
		for (int i = 0; i < str.length(); i++) {
		    if (!(Character.isDigit(str.charAt(i)) || 
				str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%'
				|| str.charAt(i) == '$' || str.charAt(i) == '_')) {
			return false;
		    }
		    else if (Character.isDigit(str.charAt(i)))
		    	hasNumber = true;
		}
		
		if (hasNumber == true)
			return true;
		else return false;		
    }
1091052
def is_number(s):
    
    try:
        float(s)
        return True
    except ValueError:
        pass

    try:
        import unicodedata
        unicodedata.numeric(s)
        return True
    except (TypeError, ValueError):
        pass

    return False
994121
public static boolean isNumeric(String str, int beginIndex, int endIndex)
    {
        for ( int i = beginIndex; i < endIndex; i++ ) {
            char chr = str.charAt(i);
            if ( ! StringUtil.isEnNumeric(chr) ) {
                return false;
            }
        }

        return true;
    }
1327997
def is_unicode_string(string):
    """"""
    try:
        if sys.version_info >= (3, 0):
            # isn't a python 3 str actually unicode
            if not isinstance(string, str):
                string.decode('utf-8')

        else:
            string.decode('utf-8')
    except UnicodeError:
        raise aomi.exceptions.Validation('Not a unicode string')
957057
function isAlphaNumericAt(str, i)
{
    var code = str.charCodeAt(i);
    //        "0" <= code <= "9"           "A" <= code <= "Z"         "a" <= code <= "z"
    return ((code > 47 && code < 58) || (code > 64 && code < 91) || code > 96 && code < 123);
}
1324299
def is_unit_or_unitstring(value):
    """"""
    if is_unit(value)[0]:
        return True, value
    try:
        unit = units.Unit(value)
    except:
        return False, value
    else:
        return True, unit