code: def parse(self, txt_file: str, use_strip: bool = True) -> List:
      contents = []
      try:
          with codecs.open(txt_file, "r", encoding="utf8") as file:
              for line in file:
                  if use_strip:
                      line = line.strip()
                  if line:
                      contents.append(line)
      except:
          with codecs.open(txt_file, "r", encoding="gbk") as file:
              for line in file:
                  if use_strip:
                      line = line.strip()
                  if line:
                      contents.append(line)
      return contents
  
file_path: PaddleHub/paddlehub/utils/parser.py
imports: import codecs
  from typing import List
  import yaml
  from paddlehub.utils.utils import sys_stdin_encoding
label_desc: Use image node_id 1 for calling the TextFileParser obj's underlying member method code with example usage: obj.parse(txt_file, use_strip) and returns: contents