1# Copyright (C) 2018 and later: Unicode, Inc. and others. 2# License & terms of use: http://www.unicode.org/copyright.html 3 4# Python 2/3 Compatibility (ICU-20299) 5# TODO(ICU-20301): Remove this. 6from __future__ import print_function 7 8from icutools.databuilder import * 9from icutools.databuilder import utils 10from icutools.databuilder.request_types import * 11 12import os 13import sys 14 15 16def generate(config, io, common_vars): 17 requests = [] 18 19 if len(io.glob("misc/*")) == 0: 20 print("Error: Cannot find data directory; please specify --src_dir", file=sys.stderr) 21 exit(1) 22 23 requests += generate_cnvalias(config, io, common_vars) 24 requests += generate_ulayout(config, io, common_vars) 25 requests += generate_uemoji(config, io, common_vars) 26 requests += generate_confusables(config, io, common_vars) 27 requests += generate_conversion_mappings(config, io, common_vars) 28 requests += generate_brkitr_brk(config, io, common_vars) 29 requests += generate_brkitr_lstm(config, io, common_vars) 30 requests += generate_brkitr_adaboost(config, io, common_vars) 31 requests += generate_stringprep(config, io, common_vars) 32 requests += generate_brkitr_dictionaries(config, io, common_vars) 33 requests += generate_normalization(config, io, common_vars) 34 requests += generate_coll_ucadata(config, io, common_vars) 35 requests += generate_full_unicore_data(config, io, common_vars) 36 requests += generate_unames(config, io, common_vars) 37 requests += generate_misc(config, io, common_vars) 38 requests += generate_curr_supplemental(config, io, common_vars) 39 requests += generate_zone_supplemental(config, io, common_vars) 40 requests += generate_translit(config, io, common_vars) 41 42 # Res Tree Files 43 # (input dirname, output dirname, resfiles.mk path, mk version var, mk source var, use pool file, dep files) 44 requests += generate_tree(config, io, common_vars, 45 "locales", 46 None, 47 config.use_pool_bundle, 48 []) 49 50 requests += generate_tree(config, io, common_vars, 51 "curr", 52 "curr", 53 config.use_pool_bundle, 54 []) 55 56 requests += generate_tree(config, io, common_vars, 57 "lang", 58 "lang", 59 config.use_pool_bundle, 60 []) 61 62 requests += generate_tree(config, io, common_vars, 63 "region", 64 "region", 65 config.use_pool_bundle, 66 []) 67 68 requests += generate_tree(config, io, common_vars, 69 "zone", 70 "zone", 71 config.use_pool_bundle, 72 []) 73 74 requests += generate_tree(config, io, common_vars, 75 "unit", 76 "unit", 77 config.use_pool_bundle, 78 []) 79 80 requests += generate_tree(config, io, common_vars, 81 "coll", 82 "coll", 83 # Never use pool bundle for coll, brkitr, or rbnf 84 False, 85 # Depends on timezoneTypes.res and keyTypeData.res. 86 # TODO: We should not need this dependency to build collation. 87 # TODO: Bake keyTypeData.res into the common library? 88 [DepTarget("coll_ucadata"), DepTarget("misc_res"), InFile("unidata/UCARules.txt")]) 89 90 requests += generate_tree(config, io, common_vars, 91 "brkitr", 92 "brkitr", 93 # Never use pool bundle for coll, brkitr, or rbnf 94 False, 95 [DepTarget("brkitr_brk"), DepTarget("dictionaries")]) 96 97 requests += generate_tree(config, io, common_vars, 98 "rbnf", 99 "rbnf", 100 # Never use pool bundle for coll, brkitr, or rbnf 101 False, 102 []) 103 104 requests += [ 105 ListRequest( 106 name = "icudata_list", 107 variable_name = "icudata_all_output_files", 108 output_file = TmpFile("icudata.lst"), 109 include_tmp = False 110 ) 111 ] 112 113 return requests 114 115 116def generate_cnvalias(config, io, common_vars): 117 # UConv Name Aliases 118 input_file = InFile("mappings/convrtrs.txt") 119 output_file = OutFile("cnvalias.icu") 120 return [ 121 SingleExecutionRequest( 122 name = "cnvalias", 123 category = "cnvalias", 124 dep_targets = [], 125 input_files = [input_file], 126 output_files = [output_file], 127 tool = IcuTool("gencnval"), 128 args = "-s {IN_DIR} -d {OUT_DIR} " 129 "{INPUT_FILES[0]}", 130 format_with = {} 131 ) 132 ] 133 134 135def generate_confusables(config, io, common_vars): 136 # CONFUSABLES 137 txt1 = InFile("unidata/confusables.txt") 138 txt2 = InFile("unidata/confusablesWholeScript.txt") 139 cfu = OutFile("confusables.cfu") 140 return [ 141 SingleExecutionRequest( 142 name = "confusables", 143 category = "confusables", 144 dep_targets = [DepTarget("cnvalias")], 145 input_files = [txt1, txt2], 146 output_files = [cfu], 147 tool = IcuTool("gencfu"), 148 args = "-d {OUT_DIR} -i {OUT_DIR} " 149 "-c -r {IN_DIR}/{INPUT_FILES[0]} -w {IN_DIR}/{INPUT_FILES[1]} " 150 "-o {OUTPUT_FILES[0]}", 151 format_with = {} 152 ) 153 ] 154 155 156def generate_conversion_mappings(config, io, common_vars): 157 # UConv Conversion Table Files 158 input_files = [InFile(filename) for filename in io.glob("mappings/*.ucm")] 159 output_files = [OutFile("%s.cnv" % v.filename[9:-4]) for v in input_files] 160 # TODO: handle BUILD_SPECIAL_CNV_FILES? Means to add --ignore-siso-check flag to makeconv 161 return [ 162 RepeatedOrSingleExecutionRequest( 163 name = "conversion_mappings", 164 category = "conversion_mappings", 165 dep_targets = [], 166 input_files = input_files, 167 output_files = output_files, 168 tool = IcuTool("makeconv"), 169 # BEGIN android-changed 170 # args = "-s {IN_DIR} -d {OUT_DIR} -c {INPUT_FILE_PLACEHOLDER}", 171 args = "-s {IN_DIR} -d {OUT_DIR} -c --small {INPUT_FILE_PLACEHOLDER}", 172 # END android-changed 173 format_with = {}, 174 repeat_with = { 175 "INPUT_FILE_PLACEHOLDER": utils.SpaceSeparatedList(file.filename for file in input_files) 176 } 177 ) 178 ] 179 180 181def generate_brkitr_brk(config, io, common_vars): 182 # BRK Files 183 input_files = [InFile(filename) for filename in io.glob("brkitr/rules/*.txt")] 184 output_files = [OutFile("brkitr/%s.brk" % v.filename[13:-4]) for v in input_files] 185 return [ 186 RepeatedExecutionRequest( 187 name = "brkitr_brk", 188 category = "brkitr_rules", 189 dep_targets = 190 [DepTarget("cnvalias"), 191 DepTarget("ulayout"), DepTarget("uemoji"), DepTarget("lstm_res"), DepTarget("adaboost_res")], 192 input_files = input_files, 193 output_files = output_files, 194 tool = IcuTool("genbrk"), 195 args = "-d {OUT_DIR} -i {OUT_DIR} " 196 "-c -r {IN_DIR}/{INPUT_FILE} " 197 "-o {OUTPUT_FILE}", 198 format_with = {}, 199 repeat_with = {} 200 ) 201 ] 202 203 204def generate_stringprep(config, io, common_vars): 205 # SPP FILES 206 input_files = [InFile(filename) for filename in io.glob("sprep/*.txt")] 207 output_files = [OutFile("%s.spp" % v.filename[6:-4]) for v in input_files] 208 bundle_names = [v.filename[6:-4] for v in input_files] 209 return [ 210 RepeatedExecutionRequest( 211 name = "stringprep", 212 category = "stringprep", 213 dep_targets = [InFile("unidata/NormalizationCorrections.txt")], 214 input_files = input_files, 215 output_files = output_files, 216 tool = IcuTool("gensprep"), 217 args = "-s {IN_DIR}/sprep -d {OUT_DIR} -i {OUT_DIR} " 218 "-b {BUNDLE_NAME} -m {IN_DIR}/unidata -u 3.2.0 {BUNDLE_NAME}.txt", 219 format_with = {}, 220 repeat_with = { 221 "BUNDLE_NAME": bundle_names 222 } 223 ) 224 ] 225 226 227def generate_brkitr_dictionaries(config, io, common_vars): 228 # Dict Files 229 input_files = [InFile(filename) for filename in io.glob("brkitr/dictionaries/*.txt")] 230 output_files = [OutFile("brkitr/%s.dict" % v.filename[20:-4]) for v in input_files] 231 extra_options_map = { 232 "brkitr/dictionaries/burmesedict.txt": "--bytes --transform offset-0x1000", 233 "brkitr/dictionaries/cjdict.txt": "--uchars", 234 "brkitr/dictionaries/khmerdict.txt": "--bytes --transform offset-0x1780", 235 "brkitr/dictionaries/laodict.txt": "--bytes --transform offset-0x0e80", 236 "brkitr/dictionaries/thaidict.txt": "--bytes --transform offset-0x0e00" 237 } 238 extra_optionses = [extra_options_map[v.filename] for v in input_files] 239 return [ 240 RepeatedExecutionRequest( 241 name = "dictionaries", 242 category = "brkitr_dictionaries", 243 dep_targets = [], 244 input_files = input_files, 245 output_files = output_files, 246 tool = IcuTool("gendict"), 247 args = "-i {OUT_DIR} " 248 "-c {EXTRA_OPTIONS} " 249 "{IN_DIR}/{INPUT_FILE} {OUT_DIR}/{OUTPUT_FILE}", 250 format_with = {}, 251 repeat_with = { 252 "EXTRA_OPTIONS": extra_optionses 253 } 254 ) 255 ] 256 257 258def generate_normalization(config, io, common_vars): 259 # NRM Files 260 input_files = [InFile(filename) for filename in io.glob("in/*.nrm")] 261 # nfc.nrm is pre-compiled into C++; see generate_full_unicore_data 262 input_files.remove(InFile("in/nfc.nrm")) 263 output_files = [OutFile(v.filename[3:]) for v in input_files] 264 return [ 265 RepeatedExecutionRequest( 266 name = "normalization", 267 category = "normalization", 268 dep_targets = [], 269 input_files = input_files, 270 output_files = output_files, 271 tool = IcuTool("icupkg"), 272 args = "-t{ICUDATA_CHAR} {IN_DIR}/{INPUT_FILE} {OUT_DIR}/{OUTPUT_FILE}", 273 format_with = {}, 274 repeat_with = {} 275 ) 276 ] 277 278 279def generate_coll_ucadata(config, io, common_vars): 280 # Collation Dependency File (ucadata.icu) 281 input_file = InFile("in/coll/ucadata-%s.icu" % config.coll_han_type) 282 output_file = OutFile("coll/ucadata.icu") 283 return [ 284 SingleExecutionRequest( 285 name = "coll_ucadata", 286 category = "coll_ucadata", 287 dep_targets = [], 288 input_files = [input_file], 289 output_files = [output_file], 290 tool = IcuTool("icupkg"), 291 args = "-t{ICUDATA_CHAR} {IN_DIR}/{INPUT_FILES[0]} {OUT_DIR}/{OUTPUT_FILES[0]}", 292 format_with = {} 293 ) 294 ] 295 296 297def generate_full_unicore_data(config, io, common_vars): 298 # The core Unicode properties files (pnames.icu, uprops.icu, ucase.icu, ubidi.icu) 299 # are hardcoded in the common DLL and therefore not included in the data package any more. 300 # They are not built by default but need to be built for ICU4J data, 301 # both in the .jar and in the .dat file (if ICU4J uses the .dat file). 302 # See ICU-4497. 303 if not config.include_uni_core_data: 304 return [] 305 306 basenames = [ 307 "pnames.icu", 308 "uprops.icu", 309 "ucase.icu", 310 "ubidi.icu", 311 "nfc.nrm" 312 ] 313 input_files = [InFile("in/%s" % bn) for bn in basenames] 314 output_files = [OutFile(bn) for bn in basenames] 315 return [ 316 RepeatedExecutionRequest( 317 name = "unicore", 318 category = "unicore", 319 input_files = input_files, 320 output_files = output_files, 321 tool = IcuTool("icupkg"), 322 args = "-t{ICUDATA_CHAR} {IN_DIR}/{INPUT_FILE} {OUT_DIR}/{OUTPUT_FILE}" 323 ) 324 ] 325 326 327def generate_unames(config, io, common_vars): 328 # Unicode Character Names 329 input_file = InFile("in/unames.icu") 330 output_file = OutFile("unames.icu") 331 return [ 332 SingleExecutionRequest( 333 name = "unames", 334 category = "unames", 335 dep_targets = [], 336 input_files = [input_file], 337 output_files = [output_file], 338 tool = IcuTool("icupkg"), 339 args = "-t{ICUDATA_CHAR} {IN_DIR}/{INPUT_FILES[0]} {OUT_DIR}/{OUTPUT_FILES[0]}", 340 format_with = {} 341 ) 342 ] 343 344 345def generate_ulayout(config, io, common_vars): 346 # Unicode text layout properties 347 basename = "ulayout" 348 input_file = InFile("in/%s.icu" % basename) 349 output_file = OutFile("%s.icu" % basename) 350 return [ 351 SingleExecutionRequest( 352 name = basename, 353 category = basename, 354 dep_targets = [], 355 input_files = [input_file], 356 output_files = [output_file], 357 tool = IcuTool("icupkg"), 358 args = "-t{ICUDATA_CHAR} {IN_DIR}/{INPUT_FILES[0]} {OUT_DIR}/{OUTPUT_FILES[0]}", 359 format_with = {} 360 ) 361 ] 362 363 364def generate_uemoji(config, io, common_vars): 365 # Unicode emoji properties 366 basename = "uemoji" 367 input_file = InFile("in/%s.icu" % basename) 368 output_file = OutFile("%s.icu" % basename) 369 return [ 370 SingleExecutionRequest( 371 name = basename, 372 category = basename, 373 dep_targets = [], 374 input_files = [input_file], 375 output_files = [output_file], 376 tool = IcuTool("icupkg"), 377 args = "-t{ICUDATA_CHAR} {IN_DIR}/{INPUT_FILES[0]} {OUT_DIR}/{OUTPUT_FILES[0]}", 378 format_with = {} 379 ) 380 ] 381 382 383def generate_misc(config, io, common_vars): 384 # Misc Data Res Files 385 input_files = [InFile(filename) for filename in io.glob("misc/*.txt")] 386 input_basenames = [v.filename[5:] for v in input_files] 387 output_files = [OutFile("%s.res" % v[:-4]) for v in input_basenames] 388 return [ 389 RepeatedExecutionRequest( 390 name = "misc_res", 391 category = "misc", 392 dep_targets = [DepTarget("cnvalias")], # ICU-21175 393 input_files = input_files, 394 output_files = output_files, 395 tool = IcuTool("genrb"), 396 args = "-s {IN_DIR}/misc -d {OUT_DIR} -i {OUT_DIR} " 397 "-k -q " 398 "{INPUT_BASENAME}", 399 format_with = {}, 400 repeat_with = { 401 "INPUT_BASENAME": input_basenames 402 } 403 ) 404 ] 405 406 407def generate_curr_supplemental(config, io, common_vars): 408 # Currency Supplemental Res File 409 input_file = InFile("curr/supplementalData.txt") 410 input_basename = "supplementalData.txt" 411 output_file = OutFile("curr/supplementalData.res") 412 return [ 413 SingleExecutionRequest( 414 name = "curr_supplemental_res", 415 category = "curr_supplemental", 416 dep_targets = [], 417 input_files = [input_file], 418 output_files = [output_file], 419 tool = IcuTool("genrb"), 420 args = "-s {IN_DIR}/curr -d {OUT_DIR}/curr -i {OUT_DIR} " 421 "-k " 422 "{INPUT_BASENAME}", 423 format_with = { 424 "INPUT_BASENAME": input_basename 425 } 426 ) 427 ] 428 429 430def generate_zone_supplemental(config, io, common_vars): 431 # tzdbNames Res File 432 input_file = InFile("zone/tzdbNames.txt") 433 input_basename = "tzdbNames.txt" 434 output_file = OutFile("zone/tzdbNames.res") 435 return [ 436 SingleExecutionRequest( 437 name = "zone_supplemental_res", 438 category = "zone_supplemental", 439 dep_targets = [], 440 input_files = [input_file], 441 output_files = [output_file], 442 tool = IcuTool("genrb"), 443 args = "-s {IN_DIR}/zone -d {OUT_DIR}/zone -i {OUT_DIR} " 444 "-k " 445 "{INPUT_BASENAME}", 446 format_with = { 447 "INPUT_BASENAME": input_basename 448 } 449 ) 450 ] 451 452 453def generate_translit(config, io, common_vars): 454 input_files = [ 455 InFile("translit/root.txt"), 456 InFile("translit/en.txt"), 457 InFile("translit/el.txt") 458 ] 459 dep_files = set(InFile(filename) for filename in io.glob("translit/*.txt")) 460 dep_files -= set(input_files) 461 dep_files = list(sorted(dep_files)) 462 input_basenames = [v.filename[9:] for v in input_files] 463 output_files = [ 464 OutFile("translit/%s.res" % v[:-4]) 465 for v in input_basenames 466 ] 467 return [ 468 RepeatedOrSingleExecutionRequest( 469 name = "translit_res", 470 category = "translit", 471 dep_targets = dep_files, 472 input_files = input_files, 473 output_files = output_files, 474 tool = IcuTool("genrb"), 475 args = "-s {IN_DIR}/translit -d {OUT_DIR}/translit -i {OUT_DIR} " 476 "-k " 477 "{INPUT_BASENAME}", 478 format_with = { 479 }, 480 repeat_with = { 481 "INPUT_BASENAME": utils.SpaceSeparatedList(input_basenames) 482 } 483 ) 484 ] 485 486 487def generate_brkitr_lstm(config, io, common_vars): 488 input_files = [InFile(filename) for filename in io.glob("brkitr/lstm/*.txt")] 489 input_basenames = [v.filename[12:] for v in input_files] 490 output_files = [ 491 OutFile("brkitr/%s.res" % v[:-4]) 492 for v in input_basenames 493 ] 494 return [ 495 RepeatedOrSingleExecutionRequest( 496 name = "lstm_res", 497 category = "brkitr_lstm", 498 dep_targets = [], 499 input_files = input_files, 500 output_files = output_files, 501 tool = IcuTool("genrb"), 502 args = "-s {IN_DIR}/brkitr/lstm -d {OUT_DIR}/brkitr -i {OUT_DIR} " 503 "-k " 504 "{INPUT_BASENAME}", 505 format_with = { 506 }, 507 repeat_with = { 508 "INPUT_BASENAME": utils.SpaceSeparatedList(input_basenames) 509 } 510 ) 511 ] 512 513def generate_brkitr_adaboost(config, io, common_vars): 514 input_files = [InFile(filename) for filename in io.glob("brkitr/adaboost/*.txt")] 515 input_basenames = [v.filename[16:] for v in input_files] 516 output_files = [ 517 OutFile("brkitr/%s.res" % v[:-4]) 518 for v in input_basenames 519 ] 520 return [ 521 RepeatedOrSingleExecutionRequest( 522 name = "adaboost_res", 523 category = "brkitr_adaboost", 524 dep_targets = [], 525 input_files = input_files, 526 output_files = output_files, 527 tool = IcuTool("genrb"), 528 args = "-s {IN_DIR}/brkitr/adaboost -d {OUT_DIR}/brkitr -i {OUT_DIR} " 529 "-k " 530 "{INPUT_BASENAME}", 531 format_with = { 532 }, 533 repeat_with = { 534 "INPUT_BASENAME": utils.SpaceSeparatedList(input_basenames) 535 } 536 ) 537 ] 538 539def generate_tree( 540 config, 541 io, 542 common_vars, 543 sub_dir, 544 out_sub_dir, 545 use_pool_bundle, 546 dep_targets): 547 requests = [] 548 category = "%s_tree" % sub_dir 549 out_prefix = "%s/" % out_sub_dir if out_sub_dir else "" 550 input_files = [InFile(filename) for filename in io.glob("%s/*.txt" % sub_dir)] 551 if sub_dir == "curr": 552 input_files.remove(InFile("curr/supplementalData.txt")) 553 if sub_dir == "zone": 554 input_files.remove(InFile("zone/tzdbNames.txt")) 555 input_basenames = [v.filename[len(sub_dir)+1:] for v in input_files] 556 output_files = [ 557 OutFile("%s%s.res" % (out_prefix, v[:-4])) 558 for v in input_basenames 559 ] 560 561 # Generate Pool Bundle 562 if use_pool_bundle: 563 input_pool_files = [OutFile("%spool.res" % out_prefix)] 564 pool_target_name = "%s_pool_write" % sub_dir 565 use_pool_bundle_option = "--usePoolBundle {OUT_DIR}/{OUT_PREFIX}".format( 566 OUT_PREFIX = out_prefix, 567 **common_vars 568 ) 569 requests += [ 570 SingleExecutionRequest( 571 name = pool_target_name, 572 category = category, 573 dep_targets = dep_targets, 574 input_files = input_files, 575 output_files = input_pool_files, 576 tool = IcuTool("genrb"), 577 args = "-s {IN_DIR}/{IN_SUB_DIR} -d {OUT_DIR}/{OUT_PREFIX} -i {OUT_DIR} " 578 "--writePoolBundle -k " 579 "{INPUT_BASENAMES_SPACED}", 580 format_with = { 581 "IN_SUB_DIR": sub_dir, 582 "OUT_PREFIX": out_prefix, 583 "INPUT_BASENAMES_SPACED": utils.SpaceSeparatedList(input_basenames) 584 } 585 ), 586 ] 587 dep_targets = dep_targets + [DepTarget(pool_target_name)] 588 else: 589 use_pool_bundle_option = "" 590 591 # Generate Res File Tree 592 requests += [ 593 RepeatedOrSingleExecutionRequest( 594 name = "%s_res" % sub_dir, 595 category = category, 596 dep_targets = dep_targets, 597 input_files = input_files, 598 output_files = output_files, 599 tool = IcuTool("genrb"), 600 # BEGIN android-changed 601 args = "-s {IN_DIR}/{IN_SUB_DIR} -d {OUT_DIR}/{OUT_PREFIX} -i {OUT_DIR} " + 602 ("--omitCollationRules " if sub_dir == "coll" else "") + 603 "{EXTRA_OPTION} -k " 604 "{INPUT_BASENAME}", 605 # END android-changed 606 format_with = { 607 "IN_SUB_DIR": sub_dir, 608 "OUT_PREFIX": out_prefix, 609 "EXTRA_OPTION": use_pool_bundle_option 610 }, 611 repeat_with = { 612 "INPUT_BASENAME": utils.SpaceSeparatedList(input_basenames) 613 } 614 ) 615 ] 616 617 # Generate res_index file 618 # Exclude the deprecated locale variants and root; see ICU-20628. This 619 # could be data-driven, but we do not want to perform I/O in this script 620 # (for example, we do not want to read from an XML file). 621 excluded_locales = set([ 622 "ja_JP_TRADITIONAL", 623 "th_TH_TRADITIONAL", 624 "de_", 625 "de__PHONEBOOK", 626 "es_", 627 "es__TRADITIONAL", 628 "root", 629 ]) 630 # Put alias locales in a separate structure; see ICU-20627 631 dependency_data = io.read_locale_deps(sub_dir) 632 if "aliases" in dependency_data: 633 alias_locales = set(dependency_data["aliases"].keys()) 634 else: 635 alias_locales = set() 636 alias_files = [] 637 installed_files = [] 638 for f in input_files: 639 file_stem = IndexRequest.locale_file_stem(f) 640 if file_stem in excluded_locales: 641 continue 642 destination = alias_files if file_stem in alias_locales else installed_files 643 destination.append(f) 644 cldr_version = dependency_data["cldrVersion"] if sub_dir == "locales" else None 645 index_file_txt = TmpFile("{IN_SUB_DIR}/{INDEX_NAME}.txt".format( 646 IN_SUB_DIR = sub_dir, 647 **common_vars 648 )) 649 index_res_file = OutFile("{OUT_PREFIX}{INDEX_NAME}.res".format( 650 OUT_PREFIX = out_prefix, 651 **common_vars 652 )) 653 index_file_target_name = "%s_index_txt" % sub_dir 654 requests += [ 655 IndexRequest( 656 name = index_file_target_name, 657 category = category, 658 installed_files = installed_files, 659 alias_files = alias_files, 660 txt_file = index_file_txt, 661 output_file = index_res_file, 662 cldr_version = cldr_version, 663 args = "-s {TMP_DIR}/{IN_SUB_DIR} -d {OUT_DIR}/{OUT_PREFIX} -i {OUT_DIR} " 664 "-k " 665 "{INDEX_NAME}.txt", 666 format_with = { 667 "IN_SUB_DIR": sub_dir, 668 "OUT_PREFIX": out_prefix 669 } 670 ) 671 ] 672 673 return requests 674