code: def _shorten_lines(py):
      max_len = 90
      lines = []
      for line in py.split("\n"):
          if len(line) <= max_len:
              lines.append(line)
              continue
          i = 0
          while len(line) > max_len:
              line = line.lstrip()
              if " " not in line[1:]:
                  lines.append(line)
                  break
              else:
                  short_line = line[:max_len]
                  line = line[max_len:]
                  if " " in short_line:
                      reversed_short_line = short_line[::-1]
                      index = reversed_short_line.find(" ") + 1
                      line = short_line[-index:] + line
                      short_line = short_line[:-index]
  
                  lines.append(short_line.lstrip())
              i += 1
              if i > 10:
                  raise
          lines.append(line.lstrip())
      return "\n".join(lines)
  
file_path: icevision/docs/tutobooks.py
imports: import json
  import os
  import random
  import shutil
  import sys
  from pathlib import Path
label_desc: Use image node_id 7 for calling a global function with example usage: _shorten_lines(py) and returns: str