code: def random_split_file(fpath: Path) -> None:
      train_file = fpath.parent / TRAIN_FILENAME
      test_file = fpath.parent / TEST_FILENAME
  
      if train_file.exists() and test_file.exists():
          print(
              "Found some files that indicate that the input data "
              "has already been shuffled and split, not doing it again."
          )
          print(f"These files are: {train_file} and {test_file}")
          return
  
      print(
          "Shuffling and splitting train/test file. This may take a while."
      )
  
      print(f"Reading data from file: {fpath}")
      with fpath.open("rt") as in_tf:
          lines = in_tf.readlines()
  
      # The first few lines are comments
      lines = lines[4:]
      print("Shuffling data")
      random.shuffle(lines)
      split_len = int(len(lines) * TRAIN_FRACTION)
  
      print("Splitting to train and test files")
      with train_file.open("wt") as out_tf_train:
          for line in lines[:split_len]:
              out_tf_train.write(line)
  
      with test_file.open("wt") as out_tf_test:
          for line in lines[split_len:]:
              out_tf_test.write(line)
  
file_path: PyTorch-BigGraph/torchbiggraph/examples/livejournal.py
imports: import argparse
  import random
  from pathlib import Path
  import attr
  import pkg_resources
  from torchbiggraph.config import add_to_sys_path, ConfigFileLoader
  from torchbiggraph.converters.importers import convert_input_data, TSVEdgelistReader
  from torchbiggraph.converters.utils import download_url, extract_gzip
  from torchbiggraph.eval import do_eval
  from torchbiggraph.train import train
  from torchbiggraph.util import set_logging_verbosity, setup_logging, SubprocessInitializer
label_desc: Use image node_id 1 for calling a global function with example usage: random_split_file(fpath) without return types