code: def _validate_deadline(x):
      if isinstance(x, bool):
          note_deprecation(
              "The deadline=%r must be a duration in milliseconds, or None to disable."
              "  Boolean deadlines are treated as ints, and deprecated."
              % (x,),
              since="2019-03-06",
          )
      if x is None:
          return x
      if isinstance(x, integer_types + (float,)):
          try:
              x = duration(milliseconds=x)
          except OverflowError:
              quiet_raise(
                  InvalidArgument(
                      "deadline=%r is invalid, because it is too large to represent "
                      "as a timedelta. Use deadline=None to disable deadlines."
                      % (x,)
                  )
              )
      if isinstance(x, datetime.timedelta):
          if x <= datetime.timedelta(0):
              raise InvalidArgument(
                  "deadline=%r is invalid, because it is impossible to meet a "
                  "deadline <= 0. Use deadline=None to disable deadlines."
                  % (x,)
              )
          return duration(seconds=x.total_seconds())
      raise InvalidArgument(
          "deadline=%r (type %s) must be a timedelta object, an integer or float number of milliseconds, "
          "or None to disable the per-test-case deadline."
          % (x, type(x).__name__)
      )
  
imports: from __future__ import absolute_import, division, print_function
  import contextlib
  import datetime
  import inspect
  import threading
  import warnings
  from enum import Enum, IntEnum, unique
  import attr
  from hypothesis.errors import HypothesisDeprecationWarning, InvalidArgument, InvalidState
  from hypothesis.internal.compat import integer_types, quiet_raise, string_types
  from hypothesis.internal.reflection import get_pretty_function_description
  from hypothesis.internal.validation import check_type, try_convert
  from hypothesis.utils.conventions import UniqueIdentifier, not_set
  from hypothesis.utils.dynamicvariables import DynamicVariable
label_desc: Use image node_id 8 for calling a global function with example usage: _validate_deadline(x) and returns: x, duration