code: def test_FloatRangeTupleDataclassField():
      # Test metadata matches expected defaults after field creation (null not allowed):
      default_floatrange_tuple = get_marshmallow_from_dataclass_field(
          schema_utils.FloatRangeTupleDataclassField()
      )
      assert default_floatrange_tuple.default == (0.9, 0.999)
  
      # Test dimensional mismatch:
      with pytest.raises(MarshmallowValidationError):
          schema_utils.FloatRangeTupleDataclassField(
              n=3, default=(1, 1)
          )
  
      # Test default schema creation:
      @dataclass
      class CustomTestSchema(schema_utils.BaseMarshmallowConfig):
          foo: Tuple[
              float, float
          ] = schema_utils.FloatRangeTupleDataclassField(
              allow_none=True
          )
  
      # Test empty load:
      assert CustomTestSchema.Schema().load({}).foo == (0.9, 0.999)
      assert CustomTestSchema.Schema().load({"foo": None}).foo is None
  
      # Test invalid loads (null, non-float values, wrong dimension):
      with pytest.raises(MarshmallowValidationError):
          CustomTestSchema.Schema().load({"foo": [1, "test"]})
      with pytest.raises(MarshmallowValidationError):
          CustomTestSchema.Schema().load({"foo": (1, 1, 1)})
  
      # Test non-default schema (N=3, other custom metadata):
      @dataclass
      class CustomTestSchema(schema_utils.BaseMarshmallowConfig):
          foo: Tuple[
              float, float
          ] = schema_utils.FloatRangeTupleDataclassField(
              n=3, default=(1, 1, 1), min=-10, max=10
          )
  
      assert CustomTestSchema.Schema().load({}).foo == (1, 1, 1)
      assert CustomTestSchema.Schema().load({"foo": [2, 2, 2]}).foo == (
          2,
          2,
          2,
      )
      assert CustomTestSchema.Schema().load({"foo": (2, 2, 2)}).foo == (
          2,
          2,
          2,
      )
  
file_path: ludwig/tests/ludwig/marshmallow/test_fields_misc.py
imports: from typing import Dict, Tuple, Union
  import pytest
  from marshmallow.exceptions import ValidationError
  from marshmallow_dataclass import dataclass
  from ludwig.config_validation.validation import get_validator, validate
  from ludwig.schema import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_FloatRangeTupleDataclassField() without return types