code: def _count_lines_in_file(fname):
      num_lines = 0
      with open(fname, "r") as fi:
          for _ in fi:
              num_lines += 1
      return num_lines
  
imports: import copy
  import os
  import json
  import jsonlines
  from typing import List, Optional, Tuple
  from parlai.core.teachers import ChunkTeacher, DialogTeacher
  from .build import build, DATASET_NAME_LOCAL, build_sample
  from .build_open import build
  from .utils.text_utils import simplify_nq_example
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.metrics import ExactMatchMetric, normalize_answer, AverageMetric
  from parlai.core.params import ParlaiParser
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  import parlai.utils.logging
label_desc: Use image node_id 1 for calling a global function with example usage: _count_lines_in_file(fname) and returns: num_lines