code: def test_process_pip_requirements(tmp_path):
      expected_mlflow_ver = _mlflow_major_version_string()
      conda_env, reqs, cons = _process_pip_requirements(["a"])
      assert _get_pip_deps(conda_env) == [expected_mlflow_ver, "a"]
      assert reqs == [expected_mlflow_ver, "a"]
      assert cons == []
  
      conda_env, reqs, cons = _process_pip_requirements(
          ["a"], pip_requirements=["b"]
      )
      assert _get_pip_deps(conda_env) == [expected_mlflow_ver, "b"]
      assert reqs == [expected_mlflow_ver, "b"]
      assert cons == []
  
      # Ensure a requirement for mlflow is preserved
      conda_env, reqs, cons = _process_pip_requirements(
          ["a"], pip_requirements=["mlflow==1.2.3"]
      )
      assert _get_pip_deps(conda_env) == ["mlflow==1.2.3"]
      assert reqs == ["mlflow==1.2.3"]
      assert cons == []
  
      # Ensure a requirement for mlflow is preserved when package hashes are specified
      hash1 = "sha256:963c22532e82a93450674ab97d62f9e528ed0906b580fadb7c003e696197557c"
      hash2 = "sha256:b15ff0c7e5e64f864a0b40c99b9a582227315eca2065d9f831db9aeb8f24637b"
      conda_env, reqs, cons = _process_pip_requirements(
          ["a"],
          pip_requirements=[
              f"mlflow==1.20.2 --hash={hash1} --hash={hash2}"
          ],
      )
      assert _get_pip_deps(conda_env) == [
          f"mlflow==1.20.2 --hash={hash1} --hash={hash2}"
      ]
      assert reqs == [f"mlflow==1.20.2 --hash={hash1} --hash={hash2}"]
      assert cons == []
  
      conda_env, reqs, cons = _process_pip_requirements(
          ["a"], extra_pip_requirements=["b"]
      )
      assert _get_pip_deps(conda_env) == [expected_mlflow_ver, "a", "b"]
      assert reqs == [expected_mlflow_ver, "a", "b"]
      assert cons == []
  
      con_file = tmp_path.joinpath("constraints.txt")
      con_file.write_text("c")
      conda_env, reqs, cons = _process_pip_requirements(
          ["a"], pip_requirements=["b", f"-c {con_file}"]
      )
      assert _get_pip_deps(conda_env) == [
          expected_mlflow_ver,
          "b",
          "-c constraints.txt",
      ]
      assert reqs == [expected_mlflow_ver, "b", "-c constraints.txt"]
      assert cons == ["c"]
  
      conda_env, reqs, cons = _process_pip_requirements(
          ["a"], extra_pip_requirements=["a[extras]"]
      )
      assert _get_pip_deps(conda_env) == [
          expected_mlflow_ver,
          "a[extras]",
      ]
      assert reqs == [expected_mlflow_ver, "a[extras]"]
      assert cons == []
  
      conda_env, reqs, cons = _process_pip_requirements(
          ["mlflow==1.2.3", "b[extra1]", "a==1.2.3"],
          extra_pip_requirements=["b[extra2]", "a[extras]"],
      )
      assert _get_pip_deps(conda_env) == [
          "mlflow==1.2.3",
          "b[extra1,extra2]",
          "a[extras]==1.2.3",
      ]
      assert reqs == [
          "mlflow==1.2.3",
          "b[extra1,extra2]",
          "a[extras]==1.2.3",
      ]
      assert cons == []
  
imports: import os
  import pytest
  import yaml
  from mlflow.exceptions import MlflowException
  from mlflow.utils.environment import _contains_mlflow_requirement, _deduplicate_requirements, _get_pip_deps, _get_pip_requirement_specifier, _is_mlflow_requirement, _is_pip_deps, _mlflow_conda_env, _overwrite_pip_deps, _parse_pip_requirements, _process_conda_env, _process_pip_requirements, _validate_env_arguments
  from tests.helper_functions import _mlflow_major_version_string
label_desc: Use image node_id 19 for calling a global function with example usage: test_process_pip_requirements(tmp_path) without return types