code: def count_lines(self, file_name):
          
          x = subprocess.check_output("wc -l " + file_name + " | sed -E 's/^[[:space:]]+//' | cut -f1 -d' '", shell=True)
          return x.strip()
docs: Uses the command-line utility wc to count the number of lines in a file. For MacOS, must strip leading whitespace from wc.
  
          :param str file_name: name of file whose lines are to be counted