code: def list_from_file(filename, encoding="utf-8"):
      """Load a text file and parse the content as a list of strings. The
      trailing "\\r" and "\\n" of each line will be removed.
  
      Note:
          This will be replaced by mmcv's version after it supports encoding.
  
      Args:
          filename (str): Filename.
          encoding (str): Encoding used to open the file. Default utf-8.
  
      Returns:
          list[str]: A list of strings.
      """
      item_list = []
      with open(filename, encoding=encoding) as f:
          for line in f:
              item_list.append(line.rstrip("\n\r"))
      return item_list
  
file_path: mmocr/mmocr/utils/fileio.py
imports: import hashlib
  import os.path
  import sys
  import warnings
  from glob import glob
  from typing import List
  from mmengine import mkdir_or_exist
label_desc: Use image node_id 2 for calling a global function with example usage: list_from_file(filename, encoding) and returns: item_list