code: def run_command(cmdline, **kwargs):
      kwargs.setdefault("capture_output", True)
      p = subprocess.run(cmdline, **kwargs)
      if p.returncode != 0:
          print(
              f"Command {cmdline} returned non-zero exit status "
              f"{p.returncode}",
              file=sys.stderr,
          )
          output = ""
          if p.stdout:
              print("Stdout was:\n" + "-" * 70, file=sys.stderr)
              output = p.stdout.decode().rstrip()
              print(output, file=sys.stderr)
              print("-" * 70, file=sys.stderr)
          if p.stderr:
              print("Stderr was:\n" + "-" * 70, file=sys.stderr)
              output = p.stderr.decode().rstrip()
              print(p.stderr.decode().rstrip(), file=sys.stderr)
              print("-" * 70, file=sys.stderr)
          raise CommandFailedException(cmdline=cmdline, output=output)
      return p.stdout
  
file_path: arrow/dev/tasks/conda-recipes/clean.py
imports: import subprocess
  from typing import Set
  import json
  import pandas
  import sys
  from packaging.version import Version
label_desc: Use image node_id 1 for calling a global function with example usage: run_command(cmdline) and returns: p