code: def _ParseCmdItem(self, cmd_input, template_file=None):
      
      # Build FSM machine from the template.
      fsm = textfsm.TextFSM(template_file)
      if not self._keys:
        self._keys = set(fsm.GetValuesByAttrib('Key'))
  
      # Pass raw data through FSM.
      table = texttable.TextTable()
      table.header = fsm.header
  
      # Fill TextTable from record entries.
      for record in fsm.ParseText(cmd_input):
        table.Append(record)
      return table
docs: Creates Texttable with output of command.
  
      Args:
        cmd_input: String, Device response.
        template_file: File object, template to parse with.
  
      Returns:
        TextTable containing command output.
  
      Raises:
        CliTableError: A template was not found for the given command.