Backport support for original codes.
176305
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return OptionNumber(key)
        if key not in OptionNumber._member_map_:
            extend_enum(OptionNumber, key, default)
        return OptionNumber[key]
845265
def _extcap_call(prog, args, keyword, values):
    """"""
    p = subprocess.Popen(
        [prog] + args,
        stdout=subprocess.PIPE, stderr=subprocess.PIPE
    )
    data, err = p.communicate()
    if p.returncode != 0:
        raise OSError("%s returned with error code %s: %s" % (prog,
                                                              p.returncode,
                                                              err))
    data = plain_str(data)
    res = []
    for ifa in data.split("\n"):
        ifa = ifa.strip()
        if not ifa.startswith(keyword):
            continue
        res.append(tuple([re.search(r"{%s=([^}]*)}" % val, ifa).group(1)
                   for val in values]))
    return res
977096
def code(self, code=None, ret_r=False):
        '''
        
        '''
        if code or ret_r:
            self._code = code
            return self
        return self._code
248641
def backend_type(path, client):
    """"""
    backends = client.list_secret_backends()['data']
    vault_path = "%s/" % path
    return backends[vault_path]['type']
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]
201450
def star_sep_check(self, original, loc, tokens):
        """"""
        return self.check_py("3", "keyword-only argument separator (add 'match' to front to produce universal code)", original, loc, tokens)
539200
function disallowed(code) {
  return (
    (code >= 0x0001 && code <= 0x0008) ||
    code === 0x000b ||
    (code >= 0x000d && code <= 0x001f) ||
    (code >= 0x007f && code <= 0x009f) ||
    (code >= 0xfdd0 && code <= 0xfdef) ||
    (code & 0xffff) === 0xffff ||
    (code & 0xffff) === 0xfffe
  )
}
718802
def get_unresolved_support_uuids(stmts):
    """"""
    return {s.uuid for stmt in stmts for s in stmt.supports + stmt.supported_by
            if isinstance(s, Unresolved)}
1186109
def reply_code_tuple(code: int) -> Tuple[int, int, int]:
    '''
    '''
    return code // 100, code // 10 % 10, code % 10
922168
function importAuthCodes(channel, codes, settings) {
    var authDir, outFile, outFileBak;

    channel.registry.importClients(codes);

    authDir = settings.authDir;
    if (settings.dumpCodes !== false) {
        outFile = settings.outFile || 'codes.imported.csv';
        if (!path.isAbsolute(outFile)) {
            outFile = path.join(settings.authDir, outFile);
        }
        outFileBak = outFile + '.bak';

        fs.rename(outFile, outFileBak, function() {
            var NDDB, db;
            NDDB = require('NDDB').NDDB;
            db = new NDDB();
            db.importDB(codes);
            // Async function. Throws errors.
            db.save(outFile);
        });
    }

    // Not needed anymore.
    delete settings.authDir;
}
740870
def uimports(code):
    
    for uimport in UIMPORTLIST:
        uimport = bytes(uimport, 'utf8')
        code = code.replace(uimport, b'u' + uimport)
    return code
45805
def new_code_block(self, **kwargs):
        """"""
        proto = {'content': '',
                 'type': self.code,
                 'IO': '',
                 'attributes': ''}
        proto.update(**kwargs)
        return proto
1138302
def _apply_search_backrefs(pattern, flags=0):
    """"""

    if isinstance(pattern, (str, bytes)):
        re_verbose = VERBOSE & flags
        if flags & V0:
            re_version = V0
        elif flags & V1:
            re_version = V1
        else:
            re_version = 0
        if not (flags & DEBUG):
            pattern = _cached_search_compile(pattern, re_verbose, re_version, type(pattern))
        else:  # pragma: no cover
            pattern = _bregex_parse._SearchParser(pattern, re_verbose, re_version).parse()
    elif isinstance(pattern, Bregex):
        if flags:
            raise ValueError("Cannot process flags argument with a compiled pattern")
        pattern = pattern._pattern
    elif isinstance(pattern, _REGEX_TYPE):
        if flags:
            raise ValueError("Cannot process flags argument with a compiled pattern!")
    else:
        raise TypeError("Not a string or compiled pattern!")
    return pattern
1279177
def color_code(self, fore=None, back=None, style=None):
        
        # Map from style type to raw code formatter function.
        colorcodes = []
        resetcodes = []
        userstyles = {'style': style, 'back': back, 'fore': fore}
        for stype in userstyles:
            stylearg = userstyles.get(stype, None)
            if not stylearg:
                # No value for this style name, don't use it.
                continue
            # Get escape code for this style.
            code = self.get_escape_code(stype, stylearg)
            stylename = str(stylearg).lower()
            if (stype == 'style') and (stylename in ('0', )):
                resetcodes.append(code)
            elif stylename.startswith('reset'):
                resetcodes.append(code)
            else:
                colorcodes.append(code)
        # Reset codes come first, to not override colors.
        return ''.join((''.join(resetcodes), ''.join(colorcodes)))
275321
def format_back(
        number: FormatArg,
        light: Optional[bool] = False,
        extended: Optional[bool] = False) -> str:
    
    return _format_code(
        number,
        backcolor=True,
        light=light,
        extended=extended
    )
1336728
function restore() {
    if (isOriginal) return;
    else isOriginal = true;
    ['log', 'debug', 'info', 'warn', 'error'].forEach((item) => {
        console[item] = originalConsoleFunctions[item];
    });
}
979791
def backend_from_fname(name):
    """"""
    ext = splitext(name)[1]

    try:
        mime = EXTS_TO_MIMETYPES[ext]

    except KeyError:
        try:
            f = open(name, 'rb')

        except IOError as e:
            # The file may not exist, we are being asked to determine it's type
            # from it's name. Other errors are unexpected.
            if e.errno != errno.ENOENT:
                raise

            # We will have to fall back upon the default backend.
            msg = "No handler for %r, defaulting to %r" % (ext, DEFAULT_MIME)
            if 'FULLTEXT_TESTING' in os.environ:
                warn(msg)
            else:
                LOGGER.debug(msg)

            mod_name = MIMETYPE_TO_BACKENDS[DEFAULT_MIME]

        else:
            with f:
                return backend_from_fobj(f)

    else:
        mod_name = MIMETYPE_TO_BACKENDS[mime]

    mod = import_mod(mod_name)
    return mod