code: def test_compose_run(arrow_compose_path):
      expected_calls = [
          format_run("conda-cpp"),
      ]
      compose = DockerCompose(arrow_compose_path)
      with assert_compose_calls(compose, expected_calls):
          compose.run("conda-cpp")
  
      expected_calls = [format_run("conda-python")]
      expected_env = PartialEnv(PYTHON="3.8")
      with assert_compose_calls(
          compose, expected_calls, env=expected_env
      ):
          compose.run("conda-python")
  
      compose = DockerCompose(
          arrow_compose_path, params=dict(PYTHON="3.9")
      )
      expected_env = PartialEnv(PYTHON="3.9")
      with assert_compose_calls(
          compose, expected_calls, env=expected_env
      ):
          compose.run("conda-python")
  
      compose = DockerCompose(
          arrow_compose_path, params=dict(PYTHON="3.9")
      )
      for command in ["bash", "echo 1"]:
          expected_calls = [
              format_run(["conda-python", command]),
          ]
          expected_env = PartialEnv(PYTHON="3.9")
          with assert_compose_calls(
              compose, expected_calls, env=expected_env
          ):
              compose.run("conda-python", command)
  
      expected_calls = [
          (
              format_run(
                  "-e CONTAINER_ENV_VAR_A=a -e CONTAINER_ENV_VAR_B=b "
                  "conda-python"
              )
          )
      ]
      compose = DockerCompose(arrow_compose_path)
      expected_env = PartialEnv(PYTHON="3.8")
      with assert_compose_calls(
          compose, expected_calls, env=expected_env
      ):
          env = collections.OrderedDict(
              [
                  ("CONTAINER_ENV_VAR_A", "a"),
                  ("CONTAINER_ENV_VAR_B", "b"),
              ]
          )
          compose.run("conda-python", env=env)
  
      expected_calls = [
          (
              format_run(
                  "--volume /host/build:/build --volume "
                  "/host/ccache:/ccache:delegated conda-python"
              )
          )
      ]
      compose = DockerCompose(arrow_compose_path)
      with assert_compose_calls(compose, expected_calls):
          volumes = (
              "/host/build:/build",
              "/host/ccache:/ccache:delegated",
          )
          compose.run("conda-python", volumes=volumes)
  
imports: import collections
  import os
  import re
  import subprocess
  from unittest import mock
  import pytest
  from archery.docker import DockerCompose
  from archery.testing import assert_subprocess_calls, override_env, PartialEnv
label_desc: Use image node_id 15 for calling a global function with example usage: test_compose_run(arrow_compose_path) without return types