class_docstr: This module provides access to data in the TOD conversations format.
  
  See core/tod.py for more info about the format.
code: def _process_line(self, line):
      blob = json.loads(line)
      if "dialog" not in blob or len(blob["dialog"]) < 1:
          return None
      rounds = []
      for raw_round in blob["dialog"][1:]:
          if "prefix_stripped_text" not in raw_round[0]:
              for i in range(len(raw_round)):
                  if (
                      PREFIXES[i] not in raw_round[i]["text"]
                      and self.opt["fail_hard"]
                  ):
                      raise RuntimeError(
                          f"Missing prefix `{PREFIXES[i]}` before turn of text: `{raw_round[i]}`"
                      )
                  raw_round[i]["prefix_stripped_text"] = raw_round[
                      i
                  ].get("text", PREFIXES[i])[len(PREFIXES[i]) :]
          if len(raw_round) != 4:
              if (
                  raw_round[0]["prefix_stripped_text"]
                  != tod.STANDARD_DONE
              ):
                  return None  # misformatted convo, don't learn this.
              break  # TodStructuredEpisode will add in [DONE]
          api_call_machine = tod.SerializationHelpers.str_to_api_dict(
              raw_round[1]["prefix_stripped_text"]
          )
          if (
              len(api_call_machine) > 0
              and tod.STANDARD_API_NAME_SLOT not in api_call_machine
          ):
              raise RuntimeError(
                  f"Trying to make API call without `{tod.STANDARD_API_NAME_SLOT}`. Call is: `{raw_round[1]['text']}`"
              )
          r = tod.TodStructuredRound(
              user_utt=raw_round[0]["prefix_stripped_text"],
              api_call_machine=api_call_machine,
              api_resp_machine=tod.SerializationHelpers.str_to_api_dict(
                  raw_round[2]["prefix_stripped_text"]
              ),
              sys_utt=raw_round[3]["prefix_stripped_text"],
          )
          rounds.append(r)
      preempt_round = blob["dialog"][0]
      if len(preempt_round) != 4:
          return None
      for i in range(len(preempt_round)):
          if "prefix_stripped_text" not in preempt_round[i]:
              preempt_round[i]["prefix_stripped_text"] = preempt_round[
                  i
              ].get("text", PREFIXES_PREEMPT[i])[
                  len(PREFIXES_PREEMPT[i]) :
              ]
  
      episode = tod.TodStructuredEpisode(
          domain=preempt_round[0].get("domain", ""),
          api_schemas_machine=tod.SerializationHelpers.str_to_api_schemas(
              preempt_round[0].get("prefix_stripped_text", "")
          ),
          goal_calls_machine=tod.SerializationHelpers.str_to_goals(
              preempt_round[3].get("prefix_stripped_text")
          ),
          rounds=rounds,
      )
      return episode
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.utils.data import DatatypeHelper
  import parlai.core.tod.tod_agents
  import parlai.core.tod.tod_core
  import json
  import os
label_desc: Use image node_id 3 for calling the JsonTodParser obj's underlying member method code with example usage: obj._process_line(line) and returns: episode, None, None, None