code: def test_check_sample_ratio_and_size_compatible():
      config = {
          "input_features": [binary_feature()],
          "output_features": [binary_feature()],
          "model_type": "ecd",
      }
      ModelConfig.from_dict(config)
  
      config["preprocessing"] = {"sample_size": 10}
      ModelConfig.from_dict(config)
  
      config["preprocessing"]["sample_ratio"] = 1
      ModelConfig.from_dict(config)
  
      config["preprocessing"]["sample_ratio"] = 0.1
      with pytest.raises(ConfigValidationError):
          ModelConfig.from_dict(config)
  
      config["preprocessing"]["sample_size"] = 0
      with pytest.raises(ConfigValidationError):
          ModelConfig.from_dict(config)
  
      del config["preprocessing"]["sample_size"]
      ModelConfig.from_dict(config)
  
imports: import contextlib
  from typing import Any, Dict, List, Optional
  import pytest
  import yaml
  from ludwig.constants import COMBINER, TYPE
  from ludwig.error import ConfigValidationError
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests.utils import binary_feature, text_feature
label_desc: Use image node_id 19 for calling a global function with example usage: test_check_sample_ratio_and_size_compatible() without return types