docs: def magic_contract(*args, **kwargs):
      """Drop-in replacement for ``pycontracts.contract`` decorator, except that it supports locally-visible types
  
      :param args: Arguments to pass to the ``contract`` decorator
      :param kwargs: Keyword arguments to pass to the ``contract`` decorator
      :return: The contracted function
      """
      def inner_decorator(f):
          for name, val in f.__globals__.items():
              if not name.startswith('_') and isinstance(val, type):
                  safe_new_contract(name, val)
          return contract(*args, **kwargs)(f)
  
      return inner_decorator