code: def nice_print(details: dict, level: int = 0) -> list:
      lines = []
      for k in sorted(details):
          key = f"* {k}:" if level == 0 else f"- {k}:"
          if isinstance(details[k], dict):
              lines += [level * LEVEL_OFFSET + key]
              lines += nice_print(details[k], level + 1)
          elif isinstance(details[k], (set, list, tuple)):
              lines += [level * LEVEL_OFFSET + key]
              lines += [
                  (level + 1) * LEVEL_OFFSET + "- " + v
                  for v in details[k]
              ]
          else:
              template = "{:%is} {}" % KEY_PADDING
              key_val = template.format(key, details[k])
              lines += [(level * LEVEL_OFFSET) + key_val]
      return lines
  
file_path: pytorch-lightning/requirements/collect_env_details.py
imports: import os
  import platform
  import sys
  import pkg_resources
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: nice_print(details, level) and returns: lines