Similar to lstring_as_obj, sets whether or not ilwd:chars should be
    treated as strings or as ints. Default is True.
777981
def ilwd_as_int(true_or_false=None):
    
    if true_or_false is not None:
        _default_types_status['ilwd_as_int'] = true_or_false
        numpy.typeDict[u'ilwd:char'] = int \
            if _default_types_status['ilwd_as_int'] \
            else 'S%i' % default_strlen
    return _default_types_status['ilwd_as_int']
218147
def is_type_text_string(obj):
    """"""
    if PY2:
        # Python 2
        return type(obj) in [str, unicode]
    else:
        # Python 3
        return type(obj) in [str, bytes]
461242
def _format_char(char):
    
    if char is None:
        return -1
    if isinstance(char, _STRTYPES) and len(char) == 1:
        return ord(char)
    try:
        return int(char) # allow all int-like objects
    except:
        raise TypeError('char single character string, integer, or None\nReceived: ' + repr(char))
1143058
def getString(t):
    
    slen = c_int()
    s = c_char_p()
    if PL_get_string_chars(t, byref(s), byref(slen)):
        return s.value
    else:
        raise InvalidTypeError("string")
745899
def as_strings(self):
        """"""
        if self.value == '' or self.value is None:
            return '{0};\n'.format(self.name)
        if '"' not in self.value and (';' in self.value or '#' in self.value):
            return '{0} "{1}";\n'.format(self.name, self.value)
        return '{0} {1};\n'.format(self.name, self.value)
261065
public static boolean isNumeric(Object obj) {
		if (obj == null) {
			return false;
		}
		char[] chars = obj.toString().toCharArray();
		int length = chars.length;
		if(length < 1)
			return false;
		
		int i = 0;
		if(length > 1 && chars[0] == '-')
			i = 1;
		
		for (; i < length; i++) {
			if (!Character.isDigit(chars[i])) {
				return false;
			}
		}
		return true;
	}
551206
function ( obj ) {
		return typeof obj === "object" ? obj : ( obj.charAt && obj.charAt( 0 ) === "#" ? utility.$( obj ) : obj );
	}
1197034
def safe_serialize_type(l):
    ''''''

    if isinstance(l, str):
        return l
    elif isinstance(l, list):
        return '%s_%s_' % (l[0], ''.join(map(safe_serialize_type, l[1:])))
    else:
        return str(l)
951885
def convert_attrs_to_int(obj: Any,
                         attrs: Iterable[str],
                         default: int = None) -> None:
    
    for a in attrs:
        value = convert_to_int(getattr(obj, a), default=default)
        setattr(obj, a, value)
1337640
def DEFINE_string(  # pylint: disable=invalid-name,redefined-builtin
    name, default, help, flag_values=_flagvalues.FLAGS, **args):
  """"""
  parser = _argument_parser.ArgumentParser()
  serializer = _argument_parser.ArgumentSerializer()
  DEFINE(parser, name, default, help, flag_values, serializer, **args)
931519
def _convert_type_to_char(self, type_char):
        
        typecode = type_char
        if type(type_char) is int:
            typecode = chr(type_char)

        if typecode in self.TYPECODES_LIST:
            return ord(typecode)
        elif len(typecode) > 1:
            if typecode[0] == "L":
                return ord(self.TYPE_OBJECT)
            elif typecode[0] == "[":
                return ord(self.TYPE_ARRAY)

        raise RuntimeError(
            "Typecode {0} ({1}) isn't supported.".format(type_char, typecode)
        )
702614
public static boolean isString( Object obj ) {
      if( (obj instanceof String)
            || (obj instanceof Character)
            || (obj != null && (obj.getClass() == Character.TYPE || String.class.isAssignableFrom( obj.getClass() ))) ){
         return true;
      }
      return false;
   }
171279
def stringToCharP(inobject, inlen=None):

    
    if inlen and isinstance(inobject, str):
        return create_string_buffer(inobject.encode(encoding='UTF-8'), inlen)
    if isinstance(inobject, bytes):
        return inobject
    if isinstance(inobject, c_int):
        return stringToCharP(" " * inobject.value)
    if isinstance(inobject, int):
        return stringToCharP(" " * inobject)
    return c_char_p(inobject.encode(encoding='UTF-8'))
919709
def to_str(obj):
    
    if not isinstance(obj, str) and PY3 and isinstance(obj, bytes):
        obj = obj.decode('utf-8')
    return obj if isinstance(obj, string_types) else str(obj)
154817
def string_to_int( s ):
  """"""
  result = 0
  for c in s:
    if not isinstance(c, int): c = ord( c )
    result = 256 * result + c
  return result
182974
def _set_types(self):
        """"""
        # If we given something that is not an int or a float we raise
        # a RuntimeError as we do not want to have to guess if the given
        # input should be interpreted as an int or a float, for example the
        # interpretation of the string "1" vs the interpretation of the string
        # "1.0".
        for c in (self.x, self.y):
            if not ( isinstance(c, int) or isinstance(c, float) ):
                raise(RuntimeError('x, y coords should be int or float'))

        if isinstance(self.x, int) and isinstance(self.y, int):
            self._dtype = "int"
        else:
            # At least one value is a float so promote both to float.
            self.x = float(self.x)
            self.y = float(self.y)
            self._dtype = "float"
538197
def is_string(obj):
    
    if PYTHON3:
        str_type = (bytes, str)
    else:
        str_type = (bytes, str, unicode)
    return isinstance(obj, str_type)