code: def chunk_file(file_path, chunks, work_dir):
      """Splits a large file by line into number of chunks and writes them into work_dir"""
      with PathManager.open(file_path) as fin:
          num_lines = sum(1 for line in fin)
  
      chunk_size = math.ceil(num_lines / chunks)
      output_file_paths = []
      with contextlib.ExitStack() as stack:
          fin = stack.enter_context(PathManager.open(file_path))
          for i, line in enumerate(fin):
              if not i % chunk_size:
                  file_split = "{}.chunk_{}".format(
                      os.path.join(
                          work_dir, os.path.basename(file_path)
                      ),
                      i // chunk_size,
                  )
                  output_file_paths.append(file_split)
                  fout = stack.enter_context(open(file_split, "w"))
              fout.write("{}\n".format(line.strip()))
  
      return output_file_paths
  
imports: import contextlib
  import math
  import os
  from iopath.common.file_io import HTTPURLHandler
  from pytorch.text.fb.utils import PATH_MANAGER
label_desc: Use image node_id 2 for calling a global function with example usage: chunk_file(file_path, chunks, work_dir) and returns: output_file_paths