code: def check_valid_size(value, name):
      """Checks that value is either unspecified, or a valid non-negative size
      expressed as an integer.
  
      Otherwise raises InvalidArgument.
      """
      if value is None and name not in ("min_size", "size"):
          return
      check_type(int, value, name)
      if value < 0:
          raise InvalidArgument(f"Invalid size {name}={value!r} < 0")
  
file_path: catboost/contrib/python/hypothesis/py3/hypothesis/internal/validation.py
imports: import decimal
  import math
  from numbers import Rational, Real
  from hypothesis.errors import InvalidArgument
  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