TODO: i18n
 Fofmat ID
 @param code [String]
 @param year [String]
 @param opts [Hash]
 @param stdClass [Symbol]
 @return [Array]
197083
def std_id(code, year, opts, stdclass)
      prefix, code = strip_id_wrapper(code, stdclass)
      ret = code
      ret += ":#{year}" if year
      ret += " (all parts)" if opts[:all_parts]
      ["#{prefix}(#{ret})", code]
    end
1256334
function (table, opts) {
            opts = opts || {};
            var m = this.outputIdentifierFunc;
            var im = this.inputIdentifierFunc;
            var parts = this.__schemaAndTable(table), schema = parts[0];
            table = parts[1];
            return this.serverVersion().chain(function (version) {
                var attNums;
                if (version >= 80100) {
                    attNums = sql.ANY("ind__indkey");
                } else {
                    attNums = [];
                    for (var i = 0; i < 32; i++) {
                        attNums.push(new Subscript("ind__indkey", [i]));
                    }
                }
                var orderRange = [];
                for (var j = 0; j < 32; j++) {
                    orderRange.push(new Subscript("ind__indkey", [j]));
                }
                orderRange = sql["case"](orderRange, 32, "att__attnum");
                var ds = this.metadataDataset.from("pg_class___tab")
                    .join("pg_index___ind", [
                        [identifier("indrelid"), identifier("oid")],
                        [im(table), "relname"]
                    ])
                    .join("pg_class___indc", [
                        [identifier("oid"), identifier("indexrelid")]
                    ])
                    .join("pg_attribute___att", [
                        [identifier("attrelid"), identifier("tab__oid")],
                        [identifier("attnum"), attNums]
                    ])
                    .filter({"indc__relkind": 'i', "ind__indisprimary": false, indexprs: null, indpred: null})
                    .order("indc__relname", orderRange)
                    .select("indc__relname___name", "ind__indisunique___unique", "att__attname___column");

                if (schema) {
                    ds = ds.join("pg_namespace___nsp", {oid: identifier("tab__relnamespace"), nspname: schema.toString()});
                }
                if (version >= 80200) {
                    ds = ds.filter({indisvalid: true});
                }
                if (version >= 80300) {
                    ds = ds.filter({indisready: true, indcheckxmin: false});
                }
                var indexes = {};
                return ds.forEach(function (r) {
                    var ident = m(r.name), i = indexes[ident];
                    if (!i) {
                        i = indexes[ident] = {columns: [], unique: r.unique};
                    }
                    i.columns.push(r.column);
                }).chain(function () {
                    return indexes;
                });
            });
        }
1277996
function f_kalem_id(kalem_id, _tahta_id, _opts) {
        var optsKalem = result.OptionsKalem(_opts);

        return (Array.isArray(kalem_id)
            ? result.dbQ.hmget_json_parse(result.kp.kalem.tablo, kalem_id)
            : result.dbQ.hget_json_parse(result.kp.kalem.tablo, kalem_id))
            .then(
                /**
                 *
                 * @param {DBKalem|DBKalem[]} _dbKalem
                 */
                function (_dbKalem) {
                    if (!_dbKalem) {
                        return null;
                    }

                    /**
                     *
                     * @param {KalemDB} _kalem
                     * @param {OptionsKalem} _optKalemBilgileri
                     * @returns {*}
                     */
                    function f_KalemBilgileriniCek(_kalem, _optKalemBilgileri) {

                        if (!_kalem) {
                            return null;
                        }

                        // > Birden fazla kalem_id için tek bir sorguyla  ne çekebiliriz?
                        // - Kalemlerin durum onayını tek bir sorguyla tümü için çekebiliriz.
                        // > Tek tek çekilmesi gereken kalem bilgileri nelerdir?
                        // - Takiptemi, teklifleri
                        // saf olarak gelen kalem bilgisini OnayDurumu, Takip ve Teklifler alanlarıyla genişleterek döneceğiz

                        var olusan_kalem = schema.f_create_default_object(schema.SCHEMA.KALEM);

                        olusan_kalem = _.extend(olusan_kalem, _kalem);

                        return result.dbQ.Q.all([
                                (_optKalemBilgileri.bOnayDurumu && _tahta_id
                                    ? f_kalem_onay_durumu(_kalem.Id, _tahta_id)
                                    : {Id: 0}),
                                (_optKalemBilgileri.bTakiptemi && _tahta_id
                                    ? result.dbQ.sismember(result.kp.tahta.ssetTakiptekiKalemleri(_tahta_id), _kalem.Id)
                                    : 0),
                                (_optKalemBilgileri.bArrTeklifleri
                                    ? f_kalem_teklif_tumu(_tahta_id, _kalem.Id)
                                    : [])
                            ])
                            .then(function (_ress) {
                                olusan_kalem.OnayDurumu = _ress[0];
                                olusan_kalem.Takip = _ress[1];
                                olusan_kalem.Teklifler = _ress[2];
                                return olusan_kalem;
                            });
                    };


                    if (Array.isArray(_dbKalem)) {// Onay durumlarını yekten çek, diğer bilgilerini her kalem için tek tek çek
                        optsKalem.bOnayDurumu = false;
                        return _dbKalem
                            .mapX(null, f_KalemBilgileriniCek, optsKalem)
                            .allX()
                            .then(function (dbKalemBilgilerle) {

                                return f_kalem_onay_durumu(kalem_id, _tahta_id)
                                    .then(function (dbKalemOnayDurumlari) {

                                        return dbKalemBilgilerle.map(function (_elm, _idx) {
                                            _elm.OnayDurumu = dbKalemOnayDurumlari[_idx];
                                            return _elm;
                                        });

                                    });
                            })
                            .fail(function (_err) {
                                throw new exception.Istisna("Kalem bilgisi çekilemedi", _err);
                            });
                    } else {
                        return f_KalemBilgileriniCek(_dbKalem, optsKalem);
                    }
                })
            .fail(function (_err) {
                console.log("DB ERROR oldu: ", _err);
                throw new exception.Istisna("Kalem bilgisi çekilemedi", "f_db_kalem_id içinde: " + _err);
            });
    }
1085920
@Override
    protected int doHashCode() {
        final OtpErlangObject.Hash hash = new OtpErlangObject.Hash(7);
        hash.combine(creation, ids[0]);
        if (isNewRef()) {
            hash.combine(ids[1], ids[2]);
        }
        return hash.valueOf();
    }
293510
function nodeInjectmd (opts) {
  const inBuf = bl()

  assert.equal(typeof opts, 'object', 'opts should be an object')
  assert.equal(typeof opts.in, 'string', 'opts.in should be a string')
  assert.equal(typeof opts.tag, 'string', 'opts.tag should be a string')

  const inFile = opts.in
  const tag = opts.tag
  const startTag = new RegExp('<!--\\s*START ' + tag + '\\s*-->')
  const endTag = new RegExp('<!--\\s*END ' + tag + '\\s*-->')

  assert.equal(typeof opts, 'object', 'opts must be an object')

  const rs = new stream.PassThrough()

  rs.pipe(inBuf)

  rs.on('end', function () {
    var tagMode = false
    const mdPath = path.join(process.cwd(), inFile)
    const irs = fs.createReadStream(mdPath)
    const its = split(parse)
    const tmpBuf = bl()

    irs.pipe(its).pipe(tmpBuf)

    tmpBuf.on('finish', function () {
      const ws = fs.createWriteStream(inFile, { flags: 'w' })
      const rs = tmpBuf.duplicate()
      rs.pipe(ws)
    })

    function parse (line) {
      if (startTag.test(line.trim())) {
        tagMode = true
        const res = line + EOL + String(inBuf) + EOL
        return res
      } else if (endTag.test(line.trim())) {
        tagMode = false
        return line + EOL
      } else if (!tagMode) {
        return line + EOL
      }
    }
  })

  return rs
}
892968
function(code)
  {
    var lineNumbers = [],
        lines = this.lines,
        firstLine = parseInt(this.opts.firstLine || 1),
        i,
        l
        ;

    for (i = 0, l = lines.length; i < l; i++)
      lineNumbers.push(i + firstLine);

    return lineNumbers;
  }
1248254
public String[] generateCodes(final String code, final String objectName) {
        return generateCodes(code, objectName, null, null);
    }
320789
private static int getYear(CSLDate date, CSLDateParser dateParser) {
		if (date == null) {
			return -1;
		}
		if (date.getDateParts() == null ||
				date.getDateParts().length == 0 ||
				date.getDateParts()[0] == null ||
				date.getDateParts()[0].length == 0) {
			if (date.getRaw() != null && !date.getRaw().isEmpty()) {
				CSLDate d = dateParser.parse(date.getRaw());
				return getYear(d, dateParser);
			}
			return -1;
		}
		return date.getDateParts()[0][0];
	}
1020946
public Classification codeOf(String classificationName, String code) {
        assertArgumentNotNull("elementName", classificationName);
        assertArgumentNotNull("code", code);
        return findClassificationMeta(classificationName, () -> {
            return "codeOf('" + classificationName + "', '" + code + "')";
        }).codeOf(code);
    }
579661
function Parser(opts) {
    opts = opts || {};
    if (opts.macros) this._macros = opts.macros;
    this._links = {}; //symbol link map
    this._rules = {}; //symbol def
    this.TRUNK = null;
    this.cache = createCache(opts.maxCache || 200);
    this.cache.set("", [[] ]); //输入空字符串返回空数组
  }
948254
public function GetAffilateCode()
    {
        $sCode = false;
        if (array_key_exists(TdbShop::SESSION_AFFILIATE_CODE, $_SESSION)) {
            $sCode = $_SESSION[TdbShop::SESSION_AFFILIATE_CODE];
        }

        return $sCode;
    }
35642
function (chrs, buffer, pos, strict, opts) {
                        var frontValue = buffer.join('').substr(5, 3);
                        if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator;
                        var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                        if (!strict && !isValid) {
                            if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
                                isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                if (isValid) {
                                    buffer[pos - 1] = "0";
                                    return { "pos": pos, "c": chrs.charAt(0) };
                                }
                            }
                        }

                        //check leap yeap
                        if (isValid) {
                            var dayMonthValue = buffer.join('').substr(4, 4) + chrs;
                            if (dayMonthValue != opts.leapday)
                                return true;
                            else {
                                var year = parseInt(buffer.join('').substr(0, 4), 10);  //detect leap year
                                if (year % 4 === 0)
                                    if (year % 100 === 0)
                                        if (year % 400 === 0)
                                            return true;
                                        else return false;
                                    else return true;
                                else return false;
                            }
                        }

                        return isValid;
                    }
1233900
def get_form_data(defopts, opts)
      # HACK: REG.API doesn't know about utf-8.
      io_encoding = 'utf8'  if !io_encoding || io_encoding == DEFAULT_IO_ENCODING
      opts = opts.to_hash  if opts.respond_to?(:to_hash)
      req_contract = RegApi2::RequestContract.new(defopts)
      opts = req_contract.validate(opts)

      form = {
        'username'          => username || DEFAULT_USERNAME,
        'password'          => password || DEFAULT_PASSWORD,
        'io_encoding'       => io_encoding,
        'lang'              => lang || DEFAULT_LANG,
        'output_format'     => 'json',
        'input_format'      => 'json',
        'show_input_params' => 0,
        'input_data'        => Yajl::Encoder.encode(opts)
      }

      form
    end
1212205
public List
getOptions(int code) {
	if (options == null)
		return Collections.EMPTY_LIST;
	List list = null;
	for (Iterator it = options.iterator(); it.hasNext(); ) {
		Option opt = (Option) it.next();
		if (opt.code == code) {
			if (list == null)
				list = new ArrayList();
			list.add(opt.data);
		}
	}
	if (list == null)
		return Collections.EMPTY_LIST;
	return list;
}
108308
static function code(string $phpCode, ?int $activeLine = null, ?array $lineRange = null, ?string $className = null): string
    {
        return static::process((string) @highlight_string($phpCode, true), $activeLine, $lineRange, $className);
    }
1035292
void generateMultiMcfClassCode(Definition def, String className, int num)
   {
      if (className == null || className.equals(""))
         return;
      if (num < 0 || num + 1 > def.getMcfDefs().size())
         return;
      try
      {

         String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";

         String javaFile =
               McfDef.class.getMethod("get" + className + "Class").invoke(def.getMcfDefs().get(num), (Object[]) null)
                     + ".java";
         FileWriter fw;
         fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());

         Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
         AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
         codeGen.setNumOfMcf(num);

         codeGen.generate(def, fw);

         fw.flush();
         fw.close();
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
   }
1240024
function OptNArgs($a)
    {
        $cnt = $dashdash = 0;
        if (is_array($a) && count($a)) {
            for ($i = 1; $i < count($a); $i++) {
                if ($dashdash
                    || !($a[$i][0] == '-' || $a[$i][0] == '+' || strchr($a[$i], '='))
                ) {
                    $cnt++;
                }
                if ($a[$i] == "--") {
                    $dashdash = 1;
                }
            }
        }
        return $cnt;
    }