code: def get_pip_packages(package_name=None):
      """Returns `pip list` output."""
  
      # systems generally have `pip` as `pip` or `pip3`
      def run_with_pip(pip):
          if get_platform() == "win32":
              system_root = os.environ.get("SYSTEMROOT", "C:\\Windows")
              findstr_cmd = os.path.join(
                  system_root, "System32", "findstr"
              )
              grep_cmd = r'{} /R "numpy torch"'.format(findstr_cmd)
          elif package_name == "torch":
              grep_cmd = 'grep "' + package_name + '"'
          else:
              grep_cmd = r'grep "numpy\|pytest\|pylint\|transformers\|psutil\|wheel\|requests\|sentencepiece\|pillow\|captum\|nvgpu\|pygit2\|torch"'
          return run_and_read_all(
              pip + " list --format=freeze | " + grep_cmd
          )
  
      out = run_with_pip("pip3")
      if out == "N/A":
          out = None
      return "pip3", out
  
imports: import locale
  import os
  import re
  import subprocess
  import sys
label_desc: Use image node_id 6 for calling a global function with example usage: get_pip_packages(package_name) and returns: str,  out, run_and_read_all