code: def has_one_trailing_newline(filename: str) -> bool:
      """
      Returns True if 'filename' has a single trailing newline
      """
      with open(filename, "rb") as f:
          start_bytes = len(f.read(2))
          if start_bytes == 0:
              # empty file
              return True
          elif start_bytes == 1:
              # 1 byte file
              return False
          else:
              # skip to the end
              f.seek(-2, os.SEEK_END)
              end_bytes = f.read(2)
  
              # should be a non-newline followed by a newline
              return end_bytes[0] != ord("\n") and end_bytes[1] == ord(
                  "\n"
              )
  
label_desc: Use image node_id 1 for calling a global function with example usage: has_one_trailing_newline(filename) and returns: True, False, unknown