class_docstr: A strategy for floating point numbers.
class_docstr_tok: ["A","strategy","for","floating","point","numbers","."]
code: def filter(self, condition):
      # Handle a few specific weird cases.
      if condition is math.isfinite:
          return FloatStrategy(
              min_value=max(self.min_value, next_up(float("-inf"))),
              max_value=min(self.max_value, next_down(float("inf"))),
              allow_nan=False,
              smallest_nonzero_magnitude=self.smallest_nonzero_magnitude,
          )
      if condition is math.isinf:
          if permitted_infs := [
              x
              for x in (-math.inf, math.inf)
              if self.min_value <= x <= self.max_value
          ]:
              return SampledFromStrategy(permitted_infs)
          return nothing()
      if condition is math.isnan:
          if not self.allow_nan:
              return nothing()
          return NanStrategy()
  
      kwargs, pred = get_float_predicate_bounds(condition)
      if not kwargs:
          return super().filter(pred)
      min_bound = max(
          kwargs.get("min_value", -math.inf), self.min_value
      )
      max_bound = min(kwargs.get("max_value", math.inf), self.max_value)
  
      # Adjustments for allow_subnormal=False, if any need to be made
      if -self.smallest_nonzero_magnitude < min_bound < 0:
          min_bound = -0.0
      elif 0 < min_bound < self.smallest_nonzero_magnitude:
          min_bound = self.smallest_nonzero_magnitude
      if -self.smallest_nonzero_magnitude < max_bound < 0:
          max_bound = -self.smallest_nonzero_magnitude
      elif 0 < max_bound < self.smallest_nonzero_magnitude:
          max_bound = 0.0
  
      if min_bound > max_bound:
          return nothing()
      if (
          min_bound > self.min_value
          or self.max_value > max_bound
          or (
              self.allow_nan
              and (-math.inf < min_bound or max_bound < math.inf)
          )
      ):
          self = type(self)(
              min_value=min_bound,
              max_value=max_bound,
              allow_nan=False,
              smallest_nonzero_magnitude=self.smallest_nonzero_magnitude,
          )
      if pred is None:
          return self
      return super().filter(pred)
  
imports: import math
  from decimal import Decimal
  from fractions import Fraction
  from typing import Literal, Optional, Union
  from hypothesis.control import reject
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.filtering import get_float_predicate_bounds, get_integer_predicate_bounds
  from hypothesis.internal.floats import SMALLEST_SUBNORMAL, float_of, float_to_int, int_to_float, is_negative, next_down, next_down_normal, next_up, next_up_normal, width_smallest_normals
  from hypothesis.internal.validation import check_type, check_valid_bound, check_valid_interval
  from hypothesis.strategies._internal.misc import nothing
  from hypothesis.strategies._internal.strategies import SampledFromStrategy, SearchStrategy
  from hypothesis.strategies._internal.utils import cacheable, defines_strategy
label_desc: Use image node_id 4 for calling the FloatStrategy obj's underlying member method code with example usage: obj.filter(condition) and returns: super, FloatStrategy, nothing, NanStrategy, super, nothing, self, SampledFromStrategy, nothing