code: def get_conda_packages(run_lambda, patterns=None):
      if patterns is None:
          patterns = DEFAULT_CONDA_PATTERNS
      conda = os.environ.get("CONDA_EXE", "conda")
      out = run_and_read_all(run_lambda, "{} list".format(conda))
      if out is None:
          return out
  
      return "\n".join(
          line
          for line in out.splitlines()
          if not line.startswith("#")
          and any(name in line for name in patterns)
      )
  
imports: import datetime
  import locale
  import re
  import subprocess
  import sys
  import os
  from collections import namedtuple
label_desc: Use image node_id 5 for calling a global function with example usage: get_conda_packages(run_lambda, patterns) and returns: str, out