code: def Q(*predicates, **query):
      
      optional_actions = query.pop("actions", [])
      if "action" in query:
          optional_actions.append(query.pop("action"))
  
      for p in predicates:
          if not callable(p):
              raise TypeError("Predicate {0!r} is not callable.".format(p))
  
      for a in optional_actions:
          if not callable(a):
              raise TypeError("Action {0!r} is not callable.".format(a))
  
      if predicates:
          predicates = tuple(
              p() if inspect.isclass(p) and issubclass(p, Action) else p
              for p in predicates
          )
          if any(isinstance(p, (CallPrinter, CodePrinter)) for p in predicates):
              # the user provided an action as a filter, remove the action then to prevent double output
              for action in optional_actions:
                  if action in (CallPrinter, CodePrinter) or isinstance(action, (CallPrinter, CodePrinter)):
                      optional_actions.remove(action)
          if query:
              predicates += Query(**query),
  
          result = And(*predicates)
      else:
          result = Query(**query)
  
      if optional_actions:
          result = When(result, *optional_actions)
  
      return result
docs: Handles situations where :class:`hunter.Query` objects (or other callables) are passed in as positional arguments.
      Conveniently converts that to an :class:`hunter.And` predicate.