code: def test_overwrite_pip_deps():
      # dependencies field doesn't exist
      name_and_channels = {"name": "env", "channels": ["conda-forge"]}
      expected = {
          **name_and_channels,
          "dependencies": [{"pip": ["scipy"]}],
      }
      assert (
          _overwrite_pip_deps(name_and_channels, ["scipy"]) == expected
      )
  
      # dependencies field doesn't contain pip dependencies
      conda_env = {**name_and_channels, "dependencies": ["pip"]}
      expected = {
          **name_and_channels,
          "dependencies": ["pip", {"pip": ["scipy"]}],
      }
      assert _overwrite_pip_deps(conda_env, ["scipy"]) == expected
  
      # dependencies field contains pip dependencies
      conda_env = {
          **name_and_channels,
          "dependencies": ["pip", {"pip": ["numpy"]}, "pandas"],
      }
      expected = {
          **name_and_channels,
          "dependencies": ["pip", {"pip": ["scipy"]}, "pandas"],
      }
      assert _overwrite_pip_deps(conda_env, ["scipy"]) == expected
  
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 7 for calling a global function with example usage: test_overwrite_pip_deps() without return types