<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_collections(self, session=None, filter=None, **kwargs):
 """Get a cursor over the collectons of this database. :Parameters: - `session` (optional):
 a :class:`~pymongo.client_session.ClientSession`. - `filter` (optional):
 A query document to filter the list of collections returned from the listCollections command. - `**kwargs` (optional):
 Optional parameters of the `listCollections command <https://docs.mongodb.com/manual/reference/command/listCollections/>`_ can be passed as keyword arguments to this method. The supported options differ by server version. :Returns: An instance of :class:`~pymongo.command_cursor.CommandCursor`. .. versionadded:: 3.6 """

        if filter is not None:
            kwargs['filter'] = filter
        read_pref = ((session and session._txn_read_preference())
                     or ReadPreference.PRIMARY)

        def _cmd(session, server, sock_info, slave_okay):
            return self._list_collections(
                sock_info, slave_okay, session, read_preference=read_pref,
                **kwargs)

        return self.__client._retryable_read(
            _cmd, read_pref, session)