Return ``True`` if the given string is a Unicode string,
    that is, of type ``unicode`` in Python 2 or ``str`` in Python 3.

    Return ``None`` if ``string`` is ``None``.

    :param str string: the string to be checked
    :rtype: bool
178384
def is_unicode_string(string):
    
    if string is None:
        return None
    if PY2:
        return isinstance(string, unicode)
    return isinstance(string, str)
612657
def to_unicode(value):
  
  if isinstance(value, str):
    return value.decode('utf-8')

  assert isinstance(value, unicode)
  return value
598135
def to_unicode(text):
    
    if not isinstance(text, str):
        tmpl = 'expected unicode string, got %s value %s'
        raise TypeError(tmpl % (type(text), text))
    return text
291049
def is_number(string):
    
    string = str(string)
    if string.isnumeric():
        return True
    try:
        float(string)
        return True
    except ValueError:
        return False
592301
def python_portable_string(string, encoding='utf-8'):
  
  if isinstance(string, six.string_types):
    return string

  if six.PY3:
    return string.decode(encoding)

  raise ValueError('Unsupported type %s' % str(type(string)))
800427
def ucnstring_to_python(ucn_string):
    
    res = re.findall("U\+[0-9a-fA-F]*", ucn_string)
    for r in res:
        ucn_string = ucn_string.replace(text_type(r), text_type(ucn_to_unicode(r)))

    ucn_string = ucn_string.encode('utf-8')

    assert isinstance(ucn_string, bytes)
    return ucn_string
1236553
def is_str(string):
    
    if sys.version_info[:2] >= (3, 0):
        return isinstance(string, str)

    return isinstance(string, basestring)
799804
def str_or_unicode(text):
    
    encoding = sys.stdout.encoding
    if sys.version_info > (3, 0):
        return text.encode(encoding).decode(encoding)
    return text.encode(encoding)
1235515
def is_std_string(type_):
    

    if utils.is_str(type_):
        return type_ in string_equivalences

    type_ = remove_alias(type_)
    type_ = remove_reference(type_)
    type_ = remove_cv(type_)
    return type_.decl_string in string_equivalences
444136
def is_unicode(string):
    """"""
    str_type = str(type(string))

    if str_type.find('str') > 0 or str_type.find('unicode') > 0:
        return True

    return False
898761
def get_encoding(input_string, guesses=None, is_html=False):
    
    converted = UnicodeDammit(input_string, override_encodings=[guesses] if guesses else [], is_html=is_html)
    return converted.original_encoding
624315
def _ensure_unicode_string(string):
        
        if not isinstance(string, six.text_type):
            string = string.decode('utf-8')
        return string
215031
def safe_unicode(value):
    
    if sys.version_info < (3,0):
        if isinstance(value, str):
            return value.decode('utf-8')
        else:
            return unicode(value)
    else:
        return str(value)
348982
def u2b(string):
    
    if ((PY2 and isinstance(string, unicode)) or
        ((not PY2) and isinstance(string, str))):
        return string.encode('utf-8')
    return string
760996
def to_unicode(text):
    
    # both str and unicode inherit from basestring
    if not isinstance(text, basestring):
        tmpl = 'expected UTF-8 encoded string or unicode, got %s value %s'
        raise TypeError(tmpl % (type(text), text))
    # return unicode strings unchanged
    if isinstance(text, unicode):
        return text
    # otherwise assume UTF-8 encoding, which also works for ASCII
    return unicode(text, 'utf-8')
207444
def _is_json(string):
        
        try:
            if isinstance(string, bytes):
                string = string.decode("utf-8")
                json.loads(string)
            elif isinstance(string, str):
                json.loads(string)
            else:
                raise TypeError("Expecting <class 'str'> or <class 'bytes'>, but {} was passed".format(type(string)))
            return string

        except ValueError:
            return False
137999
public static boolean isAllAlpha(String str) {

	if (str == null) return false;

	for (int i = str.length() - 1; i >= 0; i--) {

	    if (!Character.isLetter(str.charAt(i))) return false;
	}

	return true;
    }