code: def _format_tensor(
      s: List[str], limit: int = 1_000, style: StyleCode = Text.value
  ):
      res = []
      length = 0
      for p in s:
          if p in [",", "]", "[", "..."]:
              res.append((p, Text.subtle))
          else:
              res.append((p, style))
              length += len(p)
  
          if length > limit:
              res.append((" ... ", Text.warning))
              return res, True
  
      return res, False
  
imports: import collections
  import math
  from typing import TYPE_CHECKING, List, Tuple
  from labml.internal.util.colors import StyleCode
  from ....logger import Text
label_desc: Use image node_id 5 for calling a global function with example usage: _format_tensor(s, limit, style) and returns: res,  False, res,  True