<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_percolator(self, index, name, query, **kwargs):
 """ Create a percolator document Any kwargs will be added to the document as extra properties. """

        if isinstance(query, Query):
            query = {"query": query.serialize()}
        if not isinstance(query, dict):
            raise InvalidQuery("create_percolator() must be supplied with a Query object or dict")
        if kwargs:
            query.update(kwargs)

        path = make_path(index, '.percolator', name)
        body = json.dumps(query, cls=self.encoder)
        return self._send_request('PUT', path, body)