code: def PrintAsArpa(self):
      # Prints out the FST in ARPA format.
      assert (
          args.no_backoff_ngram_order == 1
      )  # without unigrams we couldn't
      # print as ARPA format.
  
      print("\\data\\")
      for hist_len in range(args.ngram_order):
          # print the number of n-grams.  Add 1 for the 1-gram
          # section because of <s>, we print -99 as the prob so we
          # have a place to put the backoff prob.
          print(
              "ngram {0}={1}".format(
                  hist_len + 1,
                  self.GetNumNgrams(hist_len)
                  + (1 if hist_len == 0 else 0),
              )
          )
  
      print("")
  
      for hist_len in range(args.ngram_order):
          print("\\{0}-grams:".format(hist_len + 1))
  
          # print fake n-gram for <s>, for its backoff prob.
          if hist_len == 0:
              backoff_prob = self.GetProb(
                  (self.bos_symbol,), self.backoff_symbol
              )
              if backoff_prob != None:
                  print(
                      "-99\t<s>\t{0}".format(
                          "%.5f" % math.log10(backoff_prob)
                      )
                  )
  
          for hist in self.counts[hist_len].keys():
              for word in self.counts[hist_len][
                  hist
              ].word_to_count.keys():
                  if word != self.backoff_symbol:
                      prob = self.GetProb(hist, word)
                      assert prob != None and prob > 0
                      backoff_prob = self.GetProb(
                          (hist) + (word,), self.backoff_symbol
                      )
                      line = "{0}\t{1}".format(
                          "%.5f" % math.log10(prob),
                          " ".join(
                              self.IntToString(x)
                              for x in hist + (word,)
                          ),
                      )
                      if backoff_prob != None:
                          line += "\t{0}".format(
                              "%.5f" % math.log10(backoff_prob)
                          )
                      print(line)
          print("")
      print("\\end\\")
  
imports: import argparse
  import math
  import sys
  from collections import defaultdict
label_desc: Use image node_id 21 for calling the NgramCounts obj's underlying member method code with example usage: obj.PrintAsArpa() without return types