Tests if any class inside a DalvikVMObject
    uses ASCII Obfuscation (e.g. UTF-8 Chars in Classnames)

    :param vm: `DalvikVMObject`
    :return: True if ascii obfuscation otherwise False
766304
def is_ascii_obfuscation(vm):
    
    for classe in vm.get_classes():
        if is_ascii_problem(classe.get_name()):
            return True
        for method in classe.get_methods():
            if is_ascii_problem(method.get_name()):
                return True
    return False
632674
private static boolean isVMMultidexCapable() {
        boolean isMultidexCapable = false;
        String vmVersion = System.getProperty("java.vm.version");
        try {
            Matcher matcher = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?").matcher(vmVersion);
            if (matcher.matches()) {
                int major = Integer.parseInt(matcher.group(1));
                int minor = Integer.parseInt(matcher.group(2));
                isMultidexCapable = (major > 2) || ((major == 2) && (minor >= 1));
            }
        } catch (Exception ignore) {
        }
        String multidex = isMultidexCapable ? "has Multidex support" : "does not have Multidex support";
        Log.i(AndServer.TAG, String.format("VM with version %s %s.", vmVersion, multidex));
        return false;
    }
1362493
def signature_unsafe(m: bytes, sk: bytes, pk: bytes) -> bytes:
    
    h = H(sk)
    a = decodecoord(h)
    r = Hint(h[b // 8 : b // 4] + m)
    R = scalarmult_B(r)
    S = (r + Hint(encodepoint(R) + pk + m) * a) % l
    return encodepoint(R) + encodeint(S)
286083
private boolean isSockJsSpecialChar(char ch) {
        return ch <= '\u001F'
                || ch >= '\u200C' && ch <= '\u200F'
                || ch >= '\u2028' && ch <= '\u202F'
                || ch >= '\u2060' && ch <= '\u206F'
                || ch >= '\uFFF0'
                || ch >= '\uD800' && ch <= '\uDFFF';
    }
600750
def is_android_raw(raw):
    
    val = None

    if raw[0:2] == b"PK" and b'META-INF/MANIFEST.MF' in raw:
        val = "APK"
    elif raw[0:3] == b"dex":
        val = "DEX"
    elif raw[0:3] == b"dey":
        val = "DEY"
    elif raw[0:4] == b"\x03\x00\x08\x00":
        val = "AXML"
    elif raw[0:4] == b"\x02\x00\x0C\x00":
        val = b"ARSC"

    return val
888481
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EXS_EXCEPTION_SOFTENING_RETURN_FALSE", justification = "No other simple way to determine whether class exists")
    private boolean checkConfusedName(String methodOrVariableName, String signature) {
        try {
            String name = methodOrVariableName.toLowerCase(Locale.ENGLISH);
            if ((name.endsWith("map") || (name.endsWith("set") && !name.endsWith("toset")) || name.endsWith("list") || name.endsWith("queue"))
                    && signature.startsWith("Ljava/util/")) {
                String clsName = SignatureUtils.stripSignature(signature);
                JavaClass cls = Repository.lookupClass(clsName);
                if ((cls.implementationOf(mapInterface) && !name.endsWith("map")) || (cls.implementationOf(setInterface) && !name.endsWith("set"))
                        || ((cls.implementationOf(listInterface) || cls.implementationOf(queueInterface)) && !name.endsWith("list")
                                && !name.endsWith("queue"))) {
                    return true;
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }

        return false;
    }
122998
@Override
    public boolean isCodeCType(int code, int ctype) {
        if (Config.USE_UNICODE_PROPERTIES) {
            if (ctype <= CharacterType.MAX_STD_CTYPE && code < 256)
                return isCodeCTypeInternal(code, ctype);
        } else {
            if (code < 256) return isCodeCTypeInternal(code, ctype);
        }

        if (ctype > UnicodeProperties.CodeRangeTable.length) throw new InternalError(ErrorMessages.ERR_TYPE_BUG);

        return CodeRange.isInCodeRange(UnicodeProperties.CodeRangeTable[ctype].getRange(), code);

    }
113366
public boolean isCharacter() {
		if (permissions != null
				&& (permissions.longValue() & SftpFileAttributes.S_IFCHR) == SftpFileAttributes.S_IFCHR) {
			return true;
		}
		return false;
	}
129203
def _ensure_decoded(s):
    
    if isinstance(s, (np.bytes_, bytes)):
        s = s.decode(pd.get_option('display.encoding'))
    return s
352541
def check_shell_encoding(cls):
        
        is_in_utf8 = True
        is_out_utf8 = True
        if sys.stdin.encoding not in ["UTF-8", "UTF8"]:
            is_in_utf8 = False
        if sys.stdout.encoding not in ["UTF-8", "UTF8"]:
            is_out_utf8 = False
        if (is_in_utf8) and (is_out_utf8):
            gf.print_success(u"shell encoding OK")
        else:
            gf.print_warning(u"shell encoding WARNING")
            if not is_in_utf8:
                gf.print_warning(u"  The default input encoding of your shell is not UTF-8")
            if not is_out_utf8:
                gf.print_warning(u"  The default output encoding of your shell is not UTF-8")
            gf.print_info(u"  If you plan to use aeneas on the command line,")
            if gf.is_posix():
                gf.print_info(u"  you might want to 'export PYTHONIOENCODING=UTF-8' in your shell")
            else:
                gf.print_info(u"  you might want to 'set PYTHONIOENCODING=UTF-8' in your shell")
            return True
        return False
1000701
function isIdentifierChar(code, astral) {
  if (code < 48) return code === 36;
  if (code < 58) return true;
  if (code < 65) return false;
  if (code < 91) return true;
  if (code < 97) return code === 95;
  if (code < 123) return true;
  return code >= 0xaa;
}
1323574
@FFDCIgnore(BAD_PARAM.class)
    private boolean isEncodingForWASClassic(ClientRequestInfo ri) {
        try {
            int IBM_PV_TC_ID = 0x49424d0a;
            ri.get_effective_component(IBM_PV_TC_ID);
            return true;
        } catch (BAD_PARAM bpe) {
            // Expected if not talking to a WAS Classic server with an IBM ORB.
            return false;
        }
    }
239003
private static void check(byte[] encoding) throws IOException {
        int length = encoding.length;
        if (length < 1 ||      // too short
                (encoding[length - 1] & 0x80) != 0) {  // not ended
            throw new IOException("ObjectIdentifier() -- " +
                    "Invalid DER encoding, not ended");
        }
        for (int i=0; i<length; i++) {
            // 0x80 at the beginning of a subidentifier
            if (encoding[i] == (byte)0x80 &&
                    (i==0 || (encoding[i-1] & 0x80) == 0)) {
                throw new IOException("ObjectIdentifier() -- " +
                        "Invalid DER encoding, useless extra octet detected");
            }
        }
    }
1006441
def char_to_virtual_keycode(char)

      unless char.size == 1
        raise "virtual keycode conversion is for single characters only"
      end

      code = char.unpack('U')[0]

      case char
        when '0'..'9'
          [code - ?0.ord + 0x30]
        when 'A'..'Z'
          [VK_SHIFT, code]
        when 'a'..'z'
          [code - ?a.ord + ?A.ord]
        when ' '
          [code]
        when '+'
          [VK_ADD]
        when '='
          [VK_OEM_PLUS]
        when ','
          [VK_OEM_COMMA]
        when '.'
          [VK_OEM_PERIOD]
        when '-'
          [VK_OEM_MINUS]
        when '_'
          [VK_SHIFT, VK_OEM_MINUS]

        when ';'
          [VK_OEM_1]
        when ':'
          [VK_SHIFT, VK_OEM_1]
        when '/'
          [VK_OEM_2]
        when '?'
          [VK_SHIFT, VK_OEM_2]
        when '`'
          [VK_OEM_3]
        when '~'
          [VK_SHIFT, VK_OEM_3]
        when '['
          [VK_OEM_4]
        when '{'
          [VK_SHIFT, VK_OEM_4]
        when '\\'
          [VK_OEM_5]
        when '|'
          [VK_SHIFT, VK_OEM_5]
        when ']'
          [VK_OEM_6]
        when '}'
          [VK_SHIFT, VK_OEM_6]
        when "'"
          [VK_OEM_7]
        when '"'
          [VK_SHIFT, VK_OEM_7]
        when '!'
          [VK_SHIFT, VK_1]
        when '@'
          [VK_SHIFT, VK_2]
        when '#'
          [VK_SHIFT, VK_3]
        when '$'
          [VK_SHIFT, VK_4]
        when '%'
          [VK_SHIFT, VK_5]
        when '^'
          [VK_SHIFT, VK_6]
        when '&'
          [VK_SHIFT, VK_7]
        when '*'
          [VK_SHIFT, VK_8]
        when '('
          [VK_SHIFT, VK_9]
        when ')'
          [VK_SHIFT, VK_0]

        when "\n"
          [VK_RETURN]
        else
          raise "No conversion exists for character #{char}"
      end
    end
393818
def detect_encoding(fp, default=None):
    
    init_pos = fp.tell()
    try:
        sample = fp.read(
            current_app.config.get('PREVIEWER_CHARDET_BYTES', 1024))
        # Result contains 'confidence' and 'encoding'
        result = cchardet.detect(sample)
        threshold = current_app.config.get('PREVIEWER_CHARDET_CONFIDENCE', 0.9)
        if result.get('confidence', 0) > threshold:
            return result.get('encoding', default)
        else:
            return default
    except Exception:
        current_app.logger.warning('Encoding detection failed.', exc_info=True)
        return default
    finally:
        fp.seek(init_pos)
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]
528202
def b58encode(v):
    ''''''
    if not isinstance(v, bytes):
        raise TypeError("a bytes-like object is required, not '%s'" %
                        type(v).__name__)

    origlen = len(v)
    v = v.lstrip(b'\0')
    newlen = len(v)

    p, acc = 1, 0
    for c in iseq(reversed(v)):
        acc += p * c
        p = p << 8

    result = b58encode_int(acc, default_one=False)

    return (alphabet[0] * (origlen - newlen) + result)