code: def get_pip_packages(run_lambda):
      # People generally have `pip` as `pip` or `pip3`
      def run_with_pip(pip):
          if get_platform() == "win32":
              grep_cmd = r'findstr /R "numpy torch"'
          else:
              grep_cmd = r'grep "torch\|numpy"'
          return run_and_read_all(
              run_lambda, pip + " list --format=freeze | " + grep_cmd
          )
  
      if not PY3:
          return "pip", run_with_pip("pip")
  
      # Try to figure out if the user is running pip or pip3.
      out2 = run_with_pip("pip")
      out3 = run_with_pip("pip3")
  
      num_pips = len([x for x in [out2, out3] if x is not None])
      if num_pips == 0:
          return "pip", out2
  
      if num_pips == 1:
          if out2 is not None:
              return "pip", out2
          return "pip3", out3
  
      # num_pips is 2. Return pip3 by default b/c that most likely
      # is the one associated with Python 3
      return "pip3", out3
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import locale
  import re
  import subprocess
  import sys
  import os
  from collections import namedtuple
  import logging
label_desc: Use image node_id 18 for calling a global function with example usage: get_pip_packages(run_lambda) and returns: str,  out3, run_and_read_all, str,  run_with_pip, str,  out2, str,  out3, str,  out2