获取模板, 容易被微信的文档误导，这里其实是获取模板到服务号的管理端，并不单纯是获取ID那么简单
对于相同的code，每调用一次微信后台会生成一条新的记录
@param code  模板库中模板的编号，有“TM**”和“OPENTMTM**”等形式
@return
545761
public String fetch(String code) {
        String url = WxEndpoint.get("url.template.get");
        String json = String.format("{\"template_id_short\":\"%s\"}", code);

        logger.debug("template message, get template id: {}", json);
        String response = wxClient.post(url, json);
        Map<String, Object> result = JsonMapper.defaultMapper().json2Map(response);

        if(result.containsKey("template_id")) {
            return result.get("template_id").toString();
        } else {
            throw new WxRuntimeException(999, "fetch template id failed.");
        }
    }
1091122
function getNodeFromCode(code) {
    if (convert.mapFileCommentRegex.test(code)) {
        try {
            return SourceNode.fromStringWithSourceMap(
                convertCode2Script(code),
                new SourceMapConsumer(convert.fromComment(code).toObject())
            );
        } catch (error) {
            console.error('getNodeFromCode() error: ' + error);
            const node = new SourceNode();
            node.add(convertCode2Script(code));
            return node;
        }
    } else {
        const node = new SourceNode();
        node.add(convertCode2Script(code));
        return node;
    }
}
272261
public static String getGuide(String code){
        StringBuilder builder = new StringBuilder();
        builder.append(" see ").append(code).append(" for further details.");
        return builder.toString();
    }
186539
private String compressJavascriptEmbedded(final String uri, final String code) {
        if(code == null || code.isEmpty()) {
            return code;
        }

        int index = uri.lastIndexOf('/');
        String name = uri;
        if(index > 0) {
            name = uri.substring(index + 1);
        }

        List<SourceFile> externs = Collections.emptyList();
        List<SourceFile> inputs = Arrays.asList(SourceFile.fromCode(name, code));

        CompilerOptions options = new CompilerOptions();
        CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
        com.google.javascript.jscomp.Compiler compiler = new com.google.javascript.jscomp.Compiler();
        Result result = compiler.compile(externs, inputs, options);

        if (result.success) {
            return compiler.toSource();
        }

        throw new IllegalArgumentException("Unable to compress javascript");
    }
119225
public void setCodeBuffer(CodeBuffer code) {
        mCodeBuffer = code;
        mOldLineNumberTable = mLineNumberTable;
        mOldLocalVariableTable = mLocalVariableTable;
        mOldStackMapTable = mStackMapTable;
        mAttributes.remove(mLineNumberTable);
        mAttributes.remove(mLocalVariableTable);
        mAttributes.remove(mStackMapTable);
        mLineNumberTable = null;
        mLocalVariableTable = null;
        mStackMapTable = null;
    }
331570
public AccessToken getAccessToken(String code) {
        String url = WxEndpoint.get("url.oauth.accesstoken.get");
        String formatUrl = String.format(url, wxClient.getClientId(), wxClient.getClientSecret(), code);
        logger.debug("get access token: {}", formatUrl);
        String response = wxClient.get(formatUrl, false);
        return JsonMapper.defaultMapper().fromJson(response, AccessToken.class);
    }
71607
public MatcherPattern findMatcherPattern(int patternCode) {
        MatcherPattern result = null;
        for (MatcherPattern entry : this.matcherPatterns) {
            if (entry.getPatternCode() == patternCode) {
                result = entry;
                break;
            }
        }
        return result;
    }
99411
private void getCredentials(final String code) {
        new AsyncTask<Void, Void, Boolean>() {
            @Override
            protected Boolean doInBackground(Void... params) {
                try {
                    mBootstrapper.getUserCredentials(code);
                    return true;

                } catch (IOException ex) {
                    LOGGER.error("Error getting oauth credentials", ex);
                    setResult(RESULT_CANCELED);
                    finish();

                } catch (CStorageException ex) {
                    LOGGER.error("Error getting oauth credentials", ex);
                    setResult(RESULT_CANCELED);
                    finish();
                }
                // Failure
                return false;
            }

            @Override
            protected void onPostExecute(Boolean result) {
                if(result) {
                    setResult(RESULT_OK);
                } else {
                    setResult(RESULT_CANCELED);
                }
                finish();
            }
        }.execute();
    }
856179
private static void findMethodSignatures(String code, Set<String> signatures) {
    if (code == null) {
      return;
    }
    Matcher matcher = OBJC_METHOD_DECL_PATTERN.matcher(code);
    while (matcher.find()) {
      StringBuilder signature = new StringBuilder();
      signature.append(matcher.group(1));
      if (matcher.group(2) != null) {
        signature.append(':');
        String additionalParams = matcher.group(3);
        if (additionalParams != null) {
          Matcher paramsMatcher = ADDITIONAL_PARAM_PATTERN.matcher(additionalParams);
          while (paramsMatcher.find()) {
            signature.append(paramsMatcher.group(1)).append(':');
          }
        }
      }
      signatures.add(signature.toString());
    }
  }
437640
public String[] generateCodes(final String code, final String objectName, final String field, final Class<?> fieldType) {
        
        final String baseCode = getPrefix().isEmpty() ? code : getPrefix() + code;
        final List<String> codeList = new ArrayList<>();
        
        final List<String> objectNameList = Arrays.asList(generateObjectNameCodes(objectName));
        final List<String> fieldList = new ArrayList<>();
        buildFieldList(field, fieldList);
        
        if(Utils.isNotEmpty(field)) {
            // 最後のフィールド名のみを取得する
            int dotIndex = field.lastIndexOf('.');
            if(dotIndex > 0) {
                buildFieldList(field.substring(dotIndex + 1), fieldList);
            }
        }
        
        for(final String name : objectNameList) {
            addCodes(codeList, baseCode, name, fieldList);
        }
        
        addCodes(codeList, code, null, fieldList);
        
        if(fieldType != null) {
            addCode(codeList, code, null, fieldType.getName());
            
            if(Enum.class.isAssignableFrom(fieldType)) {
                // 列挙型の場合は、java.lang.Enumとしてクラスタイプを追加する。
                addCode(codeList, code, null, Enum.class.getName());
                
            } else if(fieldType.isArray()) {
                // 配列の場合は、"配列のクラスタイプ+[]"を追加する。
                Class<?> componentType = fieldType.getComponentType();
                addCode(codeList, code, null, componentType.getName() + "[]");
                addCode(codeList, code, null, "java.lang.Object[]");
            }
        }
        
        addCode(codeList, code, null, null);
        
        return codeList.toArray(new String[codeList.size()]);
    }
1015663
public static String getValidationError(String code, Object... msgValues) {
        if (!_MESSAGES.containsKey(code))
            throw new RuntimeException("Unknown code: " + code);
        return fillMessage(_MESSAGES.get(code), msgValues);
    }
193458
public OauthGetTokenResponse getToken(String code) {
        BeanUtil.requireNonNull(code, "code is null");
        OauthGetTokenResponse response = null;
        String url = BASE_API_URL + "sns/oauth2/access_token?appid=" + this.config.getAppid() + "&secret=" + this.config.getSecret() + "&code=" + code + "&grant_type=authorization_code";
        BaseResponse r = executeGet(url);
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, OauthGetTokenResponse.class);
        return response;
    }
1155574
public List getTorsionData(String code, String id1, String id2, String id3, String id4) throws Exception {
        String dkey = "";
        if (pSet.containsKey(("torsion" + code + ";" + id1 + ";" + id2 + ";" + id3 + ";" + id4))) {
            dkey = "torsion" + code + ";" + id1 + ";" + id2 + ";" + id3 + ";" + id4;
        } else if (pSet.containsKey(("torsion" + code + ";" + id4 + ";" + id3 + ";" + id2 + ";" + id1))) {
            dkey = "torsion" + code + ";" + id4 + ";" + id3 + ";" + id2 + ";" + id1;
        } else if (pSet.containsKey(("torsion" + code + ";*;" + id2 + ";" + id3 + ";*"))) {
            dkey = "torsion" + code + ";*;" + id2 + ";" + id3 + ";*";
        } else if (pSet.containsKey(("torsion" + code + ";*;" + id3 + ";" + id2 + ";*"))) {
            dkey = "torsion" + code + ";*;" + id3 + ";" + id2 + ";*";
        } else if (pSet.containsKey(("torsion" + 0 + ";*;" + id2 + ";" + id3 + ";*"))) {
            dkey = "torsion" + 0 + ";*;" + id2 + ";" + id3 + ";*";
        } else if (pSet.containsKey(("torsion" + 0 + ";*;" + id3 + ";" + id2 + ";*"))) {
            dkey = "torsion" + 0 + ";*;" + id3 + ";" + id2 + ";*";
        } /*
           * else {
           * System.out.println("KEYError:Unknown distance key in pSet: torsion"
           * + code + ";" + id1 + ";" + id2 + ";" + id3 + ";" + id4 +
           * " take default torsion angle:" + DEFAULT_TORSION_ANGLES); return
           * DEFAULT_TORSION_ANGLE; }
           */
        //logger.debug("dkey = " + dkey);
        return (List) pSet.get(dkey);
    }
1247217
protected StatusObject generateErrorResult(String code, Throwable error) {
        // Construct error object to return
        String message = "";
        while (error != null && error.getCause() != null) {
            error = error.getCause();
        }
        if (error != null && error.getMessage() != null) {
            message = error.getMessage();
        }
        StatusObject status = new StatusObject(code, "error", message);
        if (error instanceof ClientDetailsException) {
            // Return exception details to client
            status.setApplication(((ClientDetailsException) error).getParameters());
            if (((ClientDetailsException) error).includeStacktrace()) {
                List<String> stack = new ArrayList<String>();
                for (StackTraceElement element : error.getStackTrace()) {
                    stack.add(element.toString());
                }
                status.setAdditional("stacktrace", stack);
            }
        } else if (error != null) {
            status.setApplication(error.getClass().getCanonicalName());
            List<String> stack = new ArrayList<String>();
            for (StackTraceElement element : error.getStackTrace()) {
                stack.add(element.toString());
            }
            status.setAdditional("stacktrace", stack);
        }
        return status;
    }
247613
public static DateItem fromString(String code) {
        String[] items = code.split("\n");
        if(items.length != 6) return null;
        int year, month, day, id;
        try {
            year = Integer.parseInt(items[2]);
            month = Integer.parseInt(items[3]);
            day = Integer.parseInt(items[4]);
            id = Integer.parseInt(items[5]);
        }
        catch (NumberFormatException e) {
            e.printStackTrace();
            return null;
        }
        return new DateItem(emptyToNull(items[0]), emptyToNull(items[1]), year, month, day, id);
    }
186942
public CodeAttribute getCode()
  {
    for (int i = 0; i < _attributes.size(); i++) {
      Attribute attr = _attributes.get(i);

      if (attr instanceof CodeAttribute)
        return (CodeAttribute) attr;
    }

    return null;
  }
144375
protected MessageFormat resolveCode(String code, Locale locale) {
        MessageFormat result = null;

        if (cachedMilliSecond == 0
                || ((result = cachedMessages.get(new CacheKey(
                        code, locale))) == null)
                || lastQuery + cachedMilliSecond < System.currentTimeMillis()) {
            result = resolveCodeInternal(code, locale);
            cachedMessages.put(new CacheKey(code, locale), result);
        }

        if (result != null)
            return result;

        return resolveCodeInternal(code, locale);
    }