code: def bash_capture_logs(bash_expr, var_transform=None):
      if var_transform is None:
          var_transform = lambda s: "$%s" % s
  
      cmd = "python -m metaflow.mflog.tee %s %s"
      parts = (
          bash_expr,
          cmd % (TASK_LOG_SOURCE, var_transform("MFLOG_STDOUT")),
          cmd % (TASK_LOG_SOURCE, var_transform("MFLOG_STDERR")),
      )
      return "(%s) 1>> >(%s) 2>> >(%s >&2)" % parts
  
file_path: metaflow/metaflow/mflog/__init__.py
imports: import math
  import time
  from .mflog import refine, set_should_persist
  from metaflow.util import to_unicode
  from metaflow.exception import MetaflowInternalError
label_desc: Use image node_id 1 for calling a global function with example usage: bash_capture_logs(bash_expr, var_transform) and returns: unknown