def METHOD_NAME():
  if sys.version_info < (3, 6):
    raise RuntimeError('Python 3.6 or higher is required; got: %s' % sys.version)
  if len(sys.argv) != 2:
    raise RuntimeError('Usage: python3.8 -u createEnglishWikipediaLineDocsFile.py /path/to/enwiki-20201201-lines.txt')
  if not os.path.exists('src/python/combineWikiFiles.py'):
    raise RuntimeError('Please run this in /l/util (or your equivalent!) working directory')
  big_line_file_name = sys.argv[1]
  if not big_line_file_name.endswith('.txt'):
    raise RuntimeError('output file must have .txt suffix; got: "%s"' % big_line_file_name)
  url = urllib.parse.urlparse(SOURCE_URL)
  # nocommit
  #with tempfile.TemporaryDirectory() as tmp_dir_name:
  tmp_dir_name = '/b/tmp2'
  if True:
    print(f'Using temp dir "{tmp_dir_name}"')
    free_bytes = shutil.disk_usage(tmp_dir_name).free
    # nocommit
    if free_bytes < 30 * 1024 * 1024 * 1024:
      raise RuntimeError('Only %.2f GB free space in tempdir; need ~30 GB free' % (free_bytes / 1024 / 1024 / 1024))
    local_file_name = os.path.join(tmp_dir_name, os.path.split(url.path)[-1])
    if not os.path.exists(local_file_name):
      # download Wikipedia en export, ~17 GB
      print('Downloading %s to %s...' % (SOURCE_URL, local_file_name))
      t0 = time.time()
      setup.Downloader(SOURCE_URL, local_file_name).download()
      t1 = time.time()
      print('%.1f sec to download source XML' % (t1 - t0))
    # run wikiXMLToText first, creating first enwiki-lines.txt:
    line_file_name = os.path.join(tmp_dir_name, 'enwiki-lines.txt')
    if not os.path.exists(line_file_name):
      t0 = time.time()
      with bz2.open(local_file_name, 'rt', encoding='utf-8') as f_in, open(line_file_name, 'w', encoding='utf-8') as f_out:
        wikiXMLToText.convert(f_in, f_out)
      t1 = time.time()
      print('%.1f sec to run wikiXMLToText' % (t1 - t0))
    # ~60.95 GB
    print('first file is %.2f GB' % (to_gb(os.path.getsize(line_file_name))))
    # run WikipediaExtractor second, creating extracted/AA/wiki_{00,01,02,...}:
    wiki_extract_output_dir = os.path.join(tmp_dir_name, 'wiki')
    extract_file_name = os.path.join(wiki_extract_output_dir, 'AA', 'wiki_00')
    if not os.path.exists(extract_file_name):
      splitter = WikipediaExtractor.OutputSplitter(False, sys.maxsize, wiki_extract_output_dir)
      with bz2.open(local_file_name, 'rb') as f_in:
        t0 = time.time()
        WikipediaExtractor.process_data(f_in, splitter)
        t1 = time.time()
        print('%.1f sec to run WikipediaExtractor' % (t1 - t0))
      splitter.close()
    # ~15.88 GB
    print('second file is %.2f GB' % to_gb(os.path.getsize(extract_file_name)))
    # finally, run combineWikiFiles.py to merge the two into final lines file, and keep only first three columns:
    if not os.path.exists(big_line_file_name):
      t0 = time.time()
      subprocess.check_call([sys.executable,
                             'src/python/combineWikiFiles.py',
                             '-only-three-columns',
                             line_file_name,
                             extract_file_name,
                             big_line_file_name])
      t1 = time.time()
      print('%.1f sec to run combineWikiFiles' % (t1 - t0))
    # ~13.08 GB
    print('big line file is %.2f GB' % to_gb(os.path.getsize(big_line_file_name)))
    # create binary version for big file:
    maybe_create_binary_file(big_line_file_name)
    # create ~1K sized docs file:
    medium_line_file_name = big_line_file_name.replace('.txt', '-medium.txt')
    if not os.path.exists(medium_line_file_name):
      t0 = time.time()
      subprocess.check_call([sys.executable,
                             'src/python/splitWikiLineFile.py',
                             big_line_file_name,
                             medium_line_file_name,
                             '1024'])
      t1 = time.time()
      print('%.1f sec to create big medium line file' % (t1 - t0))
    # create binary version for medium file:
    maybe_create_binary_file(medium_line_file_name)