Backport support for original codes.
183347
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Group(key)
        if key not in Group._member_map_:
            extend_enum(Group, key, default)
        return Group[key]
1186109
def reply_code_tuple(code: int) -> Tuple[int, int, int]:
    '''
    '''
    return code // 100, code // 10 % 10, code % 10
280692
def compile_rich(cls, code, path=None, extra_args=None):
        """"""

        return {
            contract_name: {
                'code': '0x' + contract.get('bin_hex'),
                'info': {
                    'abiDefinition': contract.get('abi'),
                    'compilerVersion': cls.compiler_version(),
                    'developerDoc': contract.get('devdoc'),
                    'language': 'Solidity',
                    'languageVersion': '0',
                    'source': code,
                    'userDoc': contract.get('userdoc')
                },
            }
            for contract_name, contract
            in cls.combined(code, path=path, extra_args=extra_args)
        }
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)}
728560
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return TransType(key)
        if key not in TransType._member_map_:
            extend_enum(TransType, key, default)
        return TransType[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
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)))
644539
function _rCallback (cb) {
        return function (err, res, data) {
            if (err) return cb(err);
            if (!res || res.statusCode > 400) return cb(data);

            cb(null, data);
        };
    }
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)
1094324
private void genImportCode() {
        Set<String> imports = new HashSet<String>();
        imports.add("java.util.*");
        imports.add("java.io.IOException");
        imports.add("java.lang.reflect.*");
        imports.add("com.baidu.bjf.remoting.protobuf.code.*");
        imports.add("com.baidu.bjf.remoting.protobuf.utils.*");
        imports.add("com.baidu.bjf.remoting.protobuf.*");
        imports.add("com.google.protobuf.*");

        if (!StringUtils.isEmpty(getPackage())) {
            imports.add(getTargetProxyClassname());
        }

        for (String pkg : imports) {
            templator.setVariable("importPackage", pkg);
            templator.addBlock("imports");
        }
    }
241177
function (keyCode) {
        return list.contains([
          keyMap.BACKSPACE,
          keyMap.TAB,
          keyMap.ENTER,
          keyMap.SPACE,
          keyMap.DELETE
        ], keyCode);
      }
565261
function _convertError($errorCode)
    {
		switch ($errorCode) {
			case '#NULL!':	return pack("C", 0x00);
			case '#DIV/0!':	return pack("C", 0x07);
			case '#VALUE!':	return pack("C", 0x0F);
			case '#REF!':	return pack("C", 0x17);
			case '#NAME?':	return pack("C", 0x1D);
			case '#NUM!':	return pack("C", 0x24);
			case '#N/A':	return pack("C", 0x2A);
		}
		return pack("C", 0xFF);
    }
1106943
function repoCharacter(code) {
  return (
    code === CC_SLASH ||
    code === CC_DOT ||
    code === CC_DASH ||
    decimal(code) ||
    alphabetical(code)
  )
}
93466
def get_code(self):
        """"""

        result = ''
        if self._data_struct is not None:
            result = self._data_struct[KEY_CODE]
        return result
957984
def _stripped_codes(codes):
    """"""
    return tuple([
        code.strip() for code in codes.split(',')
        if code.strip()
    ])
217397
def compatcallback(f):
    
    if getattr(click, '__version__', '0.0') >= '2.0':
        return f
    return update_wrapper(lambda ctx, value: f(ctx, None, value), f)
257038
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return ErrorCode(key)
        if key not in ErrorCode._member_map_:
            extend_enum(ErrorCode, key, default)
        return ErrorCode[key]