code: def process_document(raw_doc):
      """Extract the story and summary from a story file.
      Attributes:
          raw_story (str): content of the story file as an utf-8 encoded string.
      Raises:
          IndexError: If the stoy is empty or contains no highlights.
      """
      nonempty_lines = list(
          filter(
              lambda x: len(x) != 0,
              [line.strip() for line in raw_doc.split("\n")],
          )
      )
  
      # for some unknown reason some lines miss a period, add it
      nonempty_lines = [
          _add_missing_period(line) for line in nonempty_lines
      ]
  
      # gather article lines
      doc_lines = []
      lines = deque(nonempty_lines)
      while True:
          try:
              element = lines.popleft()
              if element.startswith("@highlight"):
                  break
              doc_lines.append(element)
          except IndexError:
              # if "@highlight" is absent from the file we pop
              # all elements until there is None, raising an exception.
              return doc_lines
  
      return doc_lines
  
imports: import re
  import html
  import logging
  import pandas
  import os
  import random
  import torch
  from pathlib import Path
  import pickle
  import shutil
  from collections import deque, namedtuple
  from torch.utils.data import Dataset, DataLoader, SequentialSampler
  from tokenizers import BertWordPieceTokenizer
  from transformers import BertTokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: process_document(raw_doc) and returns: doc_lines, doc_lines