docstr: Test -tstep, -vstep, -lstep.
  
  :param update_freq:
      update frequency
  
  We copy train_model from testing_utils to directly access train loop.
docstr_tok: ["Test","-tstep",",","-vstep",",","-lstep",".",":","param","update_freq",":","update","frequency","We","copy","train_model","from","testing_utils","to","directly","access","train","loop","."]
code: def _test_opt_step_opts(self, update_freq: int):
      """
      Test -tstep, -vstep, -lstep.
  
      :param update_freq:
          update frequency
  
      We copy train_model from testing_utils to directly access train loop.
      """
      import parlai.scripts.train_model as tms
  
      num_train_steps = 1001
      num_validations = 10
      num_logs = 100
  
      def get_tl(tmpdir):
          opt = {
              "task": "integration_tests",
              "model": "parlai.agents.test_agents.test_agents:MockTrainUpdatesAgent",
              "model_file": os.path.join(tmpdir, "model"),
              "dict_file": os.path.join(tmpdir, "model.dict"),
              # step opts
              "max_train_steps": num_train_steps,
              "validation_every_n_steps": int(
                  num_train_steps / num_validations
              ),
              "log_every_n_steps": int(num_train_steps / num_logs),
              "update_freq": update_freq,
          }
          parser = tms.setup_args()
          parser.set_params(**opt)
          popt = parser.parse_args([])
          for k, v in opt.items():
              popt[k] = v
          return tms.TrainLoop(popt)
  
      with testing_utils.capture_output(), testing_utils.tempdir() as tmpdir:
          tl = get_tl(tmpdir)
          valid, _ = tl.train()
  
      self.assertEqual(
          tl.valid_reports[-1]["total_train_updates"],
          num_train_steps - 1,
      )
      self.assertEqual(len(tl.valid_reports), num_validations)
      self.assertEqual(len(tl.train_reports), num_logs)
  
imports: import os
  import unittest
  import json
  import parlai.utils.logging
  import parlai.utils.testing
  from parlai.utils.io import PathManager
  from parlai.core.metrics import AverageMetric
  from parlai.core.worlds import create_task
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.agents import register_agent, Agent
  from parlai.scripts.eval_model import get_task_world_logs
label_desc: Use image node_id 6 for calling the TestTrainModel obj's underlying member method code with example usage: obj._test_opt_step_opts(update_freq) and returns: tms