code: def run_script(task, det_suffix=None, args=None):
      # import module, capture stdout
      test = imp.load_source("test", eval_script)
      sys.argv = [
          eval_script,
          task,
          "--csv",
          DETECTIONS_PATH,
          ANNOTATIONS_PATH,
      ]
      if det_suffix:
          sys.argv.extend(["-d", det_suffix])
      if args:
          sys.argv.extend(args)
      backup = sys.stdout
      sys.stdout = StringIO()
      # run evaluation script
      test.main()
      # get data from stdout, restore environment
      data = sys.stdout.getvalue()
      sys.stdout.close()
      sys.stdout = backup
      return data.splitlines()
  
file_path: madmom/tests/test_bin_evaluate.py
imports: from __future__ import absolute_import, division, print_function
  import imp
  import os
  import sys
  import unittest
  import numpy
  from .None import ANNOTATIONS_PATH, DETECTIONS_PATH
  from madmom.evaluation.beats import BeatIntervalError
label_desc: Use image node_id 1 for calling a global function with example usage: run_script(task, det_suffix, args) and returns: data