@use_kwargs(get_args)<EOL><INDENT>def get(self, query, sort, page, size):<DEDENT>
urlkwargs = {<EOL>'<STR_LIT:q>': query,<EOL>'<STR_LIT>': sort,<EOL>'<STR_LIT:size>': size,<EOL>}<EOL>communities = Community.filter_communities(query, sort)<EOL>page = communities.paginate(page, size)<EOL>links = default_links_pagination_factory(page, urlkwargs)<EOL>links_headers = map(lambda key: ('<STR_LIT>', '<STR_LIT>'.format(<EOL>key, links[key])), links)<EOL>return self.make_response(<EOL>page,<EOL>headers=links_headers,<EOL>links_item_factory=default_links_item_factory,<EOL>page=page,<EOL>urlkwargs=urlkwargs,<EOL>links_pagination_factory=default_links_pagination_factory,<EOL>)<EOL>
Get a list of all the communities.

        .. http:get:: /communities/(string:id)
            Returns a JSON list with all the communities.
            **Request**:
            .. sourcecode:: http
                GET /communities HTTP/1.1
                Accept: application/json
                Content-Type: application/json
                Host: localhost:5000
            :reqheader Content-Type: application/json
            **Response**:
            .. sourcecode:: http
                HTTP/1.0 200 OK
                Content-Length: 334
                Content-Type: application/json
                [
                    {
                        "id": "comm1"
                    },
                    {
                        "id": "comm2"
                    }
                ]
            :resheader Content-Type: application/json
            :statuscode 200: no error