def _format_query(self,
                      order=DFP_QUERY_DEFAULTS['order'],
                      limit=None,
                      offset=DFP_QUERY_DEFAULTS['offset'],
                      **filter_kwargs):
        if order:
            query = "ORDER BY {order}".format(order=order)
        else:
            query = ""

        filters = []
        for key, val in filter_kwargs.iteritems():
            if isinstance(val, list):
                # gotta format that in query
                _dfp_list = ", ".join([str(x) for x in val])
                filters.append("{0} IN ({1})".format(key, _dfp_list))
                pass
            else:
                filters.append("{0}={1}".format(key, val))
        if filters:
            # Prepend the where parameters to the base query
            where_query = " AND ".join(filters)

            query = "WHERE {where} {order}".format(
                where=where_query,
                order=query,
            )

        statement = FilterStatement(query)
        if limit:
            statement.limit = limit
        if offset:
            statement.offset = offset

        return statement
Sets up consistent test data for a cluster with a couple of nodes.
dataset/ETHPy150Open chartbeat-labs/parselmouth/parselmouth/adapters/dfp/client.py/DFPClient._format_query--crossover with--dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.backend_unittest.py/TestAddRemoveGenerateNodeSshKey._SetupTestData