Backport support for original codes.
359603
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return TOS_THR(key)
        if key not in TOS_THR._member_map_:
            extend_enum(TOS_THR, key, default)
        return TOS_THR[key]
235785
def backtrack(self, source):
        """"""
        key = self.get_tok(source)
        s = self[key]()
        meta = s.metadata['original_source']
        cls = meta['cls']
        args = meta['args']
        kwargs = meta['kwargs']
        cls = import_name(cls)
        sout = cls(*args, **kwargs)
        sout.metadata = s.metadata['original_metadata']
        sout.name = s.metadata['original_name']
        return sout
669465
def backend_from_mime(mime):
    """"""
    try:
        mod_name = MIMETYPE_TO_BACKENDS[mime]

    except KeyError:
        msg = "No handler for %r, defaulting to %r" % (mime, DEFAULT_MIME)
        if 'FULLTEXT_TESTING' in os.environ:
            warn(msg)
        else:
            LOGGER.debug(msg)

        mod_name = MIMETYPE_TO_BACKENDS[DEFAULT_MIME]
    mod = import_mod(mod_name)
    return mod
769142
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return ESP_TransformSuite(key)
        if key not in ESP_TransformSuite._member_map_:
            extend_enum(ESP_TransformSuite, key, default)
        return ESP_TransformSuite[key]
49218
def scan_used_functions(example_file, gallery_conf):
    """"""
    example_code_obj = identify_names(example_file)
    if example_code_obj:
        codeobj_fname = example_file[:-3] + '_codeobj.pickle.new'
        with open(codeobj_fname, 'wb') as fid:
            pickle.dump(example_code_obj, fid, pickle.HIGHEST_PROTOCOL)
        _replace_md5(codeobj_fname)

    backrefs = set('{module_short}.{name}'.format(**entry)
                   for entry in example_code_obj.values()
                   if entry['module'].startswith(gallery_conf['doc_module']))

    return backrefs
1367974
def set_default_backend(name: str):
    """"""
    global _default_backend
    if name == "bokeh":
        raise RuntimeError("Support for bokeh has been discontinued. At some point, we may return to support holoviews.")
    if not name in backends:
        raise RuntimeError("Backend {0} is not supported and cannot be set as default.".format(name))
    _default_backend = name
1111187
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return TOS_REL(key)
        if key not in TOS_REL._member_map_:
            extend_enum(TOS_REL, key, default)
        return TOS_REL[key]
45805
def new_code_block(self, **kwargs):
        """"""
        proto = {'content': '',
                 'type': self.code,
                 'IO': '',
                 'attributes': ''}
        proto.update(**kwargs)
        return proto
575174
def _build_return_code_enum():
    
    prefix = 'XTT_RETURN_'
    codes = {k[len(prefix):]:v for (k, v) in vars(_lib).items() if k.startswith(prefix)}
    return IntEnum('ReturnCode', codes)
1011133
def make_legacy_input(outpoint, stack_script, redeem_script, sequence):
    '''
    
    '''
    if 'decred' in riemann.get_current_network_name():
        return tx.DecredTxIn(
            outpoint=outpoint,
            sequence=utils.i2le_padded(sequence, 4))
    return tx.TxIn(outpoint=outpoint,
                   stack_script=stack_script,
                   redeem_script=redeem_script,
                   sequence=utils.i2le_padded(sequence, 4))
361049
function(newval, oldval) {
		if ([newval, oldval].every(function(val) {
			return val.contains('edbml.$');
		})) {
			var newkeys = gui.KeyMaster.extractKey(newval);
			var oldkeys = gui.KeyMaster.extractKey(oldval);
			if (newkeys && oldkeys) {
				oldkeys.forEach(function(oldkey, i) {
					var newkey = newkeys[i];
					newval = newval.replace(newkey, '');
					oldval = oldval.replace(oldkey, '');
					this._functions[oldkey] = newkey;
				}, this);
				return newval === oldval;
			}
		}
		return false;
	}
115505
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Checksum(key)
        if key not in Checksum._member_map_:
            extend_enum(Checksum, key, default)
        return Checksum[key]
1255446
def backend_from_fobj(f):
    """"""
    if magic is None:
        warn("magic lib is not installed; assuming mime type %r" % (
            DEFAULT_MIME))
        return backend_from_mime(DEFAULT_MIME)
    else:
        offset = f.tell()
        try:
            f.seek(0)
            chunk = f.read(MAGIC_BUFFER_SIZE)
            mime = magic.from_buffer(chunk, mime=True)
            return backend_from_mime(mime)
        finally:
            f.seek(offset)
1275479
function handleNotKeydown(keyCodes, e, callback) {
    const keyCode = e.charCode || e.keyCode;
    if (keyCodes.indexOf(keyCode) === -1) {
        callback();
    }
}
600843
def get_backend_init_list(backend_vals):
    """"""
    cmd_list = []
    for (key, val) in backend_vals.items():
        cmd_list.append('-backend-config')
        cmd_list.append(key + '=' + val)
    return cmd_list
997430
@Override
    public void sawOpcode(int seen) {
        stack.precomputation(this);

        switch (seen) {
            case Const.INVOKESTATIC: {
                String className = getClassConstantOperand();
                for (Backports backport : BACKPORTS) {
                    if (className.startsWith(backport.getPathPrefix())) {
                        if (clsVersion >= backport.getMinimumJDK()) {
                            reportBug(backport.getLibrary());
                            break;
                        }
                    }
                }
            }
            break;

            case Const.INVOKESPECIAL: {
                String className = getClassConstantOperand();
                String methodName = getNameConstantOperand();
                for (Backports backport : BACKPORTS) {
                    if (Values.CONSTRUCTOR.equals(methodName) && className.startsWith(backport.getPathPrefix()) && (clsVersion >= backport.getMinimumJDK())) {
                        reportBug(backport.getLibrary());
                        break;
                    }
                }
            }
            break;

            default:
            break;
        }
    }
687464
private void useGoBack(int numberOfTimes){
		for(int i = 0; i < numberOfTimes; i++){
			try {
				inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
				sleeper.sleep(MINISLEEP);
				inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
			} catch (Throwable ignored) {
				// Guard against lack of INJECT_EVENT permission
			}
		}
	}