code: def _validate_phases(phases):
      if phases is None:
          phases = tuple(Phase)
          note_deprecation(
              "Use phases=%r, not None." % (phases,), since="2019-08-05"
          )
      phases = tuple(phases)
      for a in phases:
          if not isinstance(a, Phase):
              raise InvalidArgument("%r is not a valid phase" % (a,))
      return tuple(p for p in list(Phase) if p in phases)
  
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 6 for calling a global function with example usage: _validate_phases(phases) and returns: tuple