code: def current_op(self, include_all=False, session=None):
          
          cmd = SON([("currentOp", 1), ("$all", include_all)])
          with self.__client._socket_for_writes(session) as sock_info:
              if sock_info.max_wire_version >= 4:
                  return self.__client.admin._command(
                      sock_info, cmd, codec_options=self.codec_options,
                      session=session)
              else:
                  spec = {"$all": True} if include_all else {}
                  return _first_batch(sock_info, "admin", "$cmd.sys.inprog",
                                      spec, -1, True, self.codec_options,
                                      ReadPreference.PRIMARY, cmd,
                                      self.client._event_listeners)
docs: Get information on operations currently running.
  
          :Parameters:
            - `include_all` (optional): if ``True`` also list currently
              idle operations in the result
            - `session` (optional): a
              :class:`~pymongo.client_session.ClientSession`.
  
          .. versionchanged:: 3.6
             Added ``session`` parameter.