code: def check_valid_size(value, name):
      """Checks that value is either unspecified, or a valid non-negative size
      expressed as an integer/float.
  
      Otherwise raises InvalidArgument.
      """
      if value is None:
          if name == "min_size":
              from hypothesis._settings import note_deprecation
  
              note_deprecation(
                  "min_size=None is deprecated; use min_size=0 instead.",
                  since="2018-10-06",
              )
          return
      if isinstance(value, float):
          if math.isnan(value):
              raise InvalidArgument(
                  "Invalid size %s=%r" % (name, value)
              )
          from hypothesis._settings import note_deprecation
  
          note_deprecation(
              "Float size are deprecated: "
              "%s should be an integer, got %r" % (name, value),
              since="2018-10-11",
          )
      else:
          check_type(integer_types, value, name)
      if value < 0:
          raise InvalidArgument(
              "Invalid size %s=%r < 0" % (name, value)
          )
  
file_path: catboost/contrib/python/hypothesis/py2/hypothesis/internal/validation.py
imports: from __future__ import absolute_import, division, print_function
  import decimal
  import math
  from numbers import Rational, Real
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.compat import integer_types
  from hypothesis.internal.coverage import check_function
label_desc: Use image node_id 6 for calling a global function with example usage: check_valid_size(value, name) without return types