def replace_members(self, image_id, member_data):
        if isinstance(member_data, (list, tuple)):
            member_data = dict(memberships=list(member_data))
        elif (isinstance(member_data, dict) and
              'memberships' not in member_data):
            member_data = dict(memberships=[member_data])

        body = json.dumps(member_data)

        headers = {'Content-Type': 'application/json', }

        res = self.do_request("PUT", "/images/%s/members" % image_id,
                              body, headers)
        return res.status == 204
Like L{test_reentrantStreamingProducerUsingWrite}, but for calls to
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/registry/client.py/RegistryClient.replace_members--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_internet.py/TestProducer.test_reentrantStreamingProducerUsingWriteSequence