class_docstr: Defines the protocol for chatting with starcraft.
docstr: Return a string form of this packet.
docstr_tok: ["Return","a","string","form","of","this","packet","."]
code: def _packet_str(self, packet):
      """Return a string form of this packet."""
      max_lines = FLAGS.sc2_verbose_protocol
      packet_str = str(packet).strip()
      if max_lines <= 0:
          return packet_str
      lines = packet_str.split("\n")
      line_count = len(lines)
      lines = [line[:MAX_WIDTH] for line in lines[: max_lines + 1]]
      if (
          line_count > max_lines + 1
      ):  # +1 to prefer the last line to skipped msg.
          lines[-1] = "***** %s lines skipped *****" % (
              line_count - max_lines
          )
      return "\n".join(lines)
  
imports: import contextlib
  import enum
  import itertools
  import os
  import socket
  import sys
  import time
  from absl import flags
  from absl import logging
  from pysc2.lib import stopwatch
  import websocket
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 8 for calling the StarcraftProtocol obj's underlying member method code with example usage: obj._packet_str(packet) and returns: str, packet_str