https://github.com/benoitc/couchdbkit/blob/master/couchdbkit/client.py#L1036