'Return an explain plan record for the
:class:`~mongoengine.queryset.QuerySet`\ \'s cursor.
:param format: format the plan before returning it'

def explain(self, format=False):

    plan = self._cursor.explain()
    if format:
        msg = '"format"    param    of    BaseQuerySet.explain    has    been    deprecated    and    will    be    removed    in    future    versions.'
        warnings.warn(msg, DeprecationWarning)
        plan = pprint.pformat(plan)
    return plan
