Creates a new merkledag object based on an existing one.

        The new object will have the same links as the old object but
        with the provided data instead of the old object's data contents.

        .. code-block:: python

            >>> c.object_patch_set_data(
            ...     'QmNtXbF3AjAk59gQKRgEdVabHcSsiPUnJwHnZKyj2x8Z3k',
            ...     io.BytesIO(b'bla')
            ... )
            {'Hash': 'QmSw3k2qkv4ZPsbu9DVEJaTMszAQWNgM1FTFYpfZeNQWrd'}

        Parameters
        ----------
        root : str
            IPFS hash of the object to modify
        data : io.RawIOBase
            The new data to store in root

        Returns
        -------
            dict : Hash of new object

def object_patch_set_data(self, root, data, **kwargs):
        """Creates a new merkledag object based on an existing one.

        The new object will have the same links as the old object but
        with the provided data instead of the old object's data contents.

        .. code-block:: python

            >>> c.object_patch_set_data(
            ...     'QmNtXbF3AjAk59gQKRgEdVabHcSsiPUnJwHnZKyj2x8Z3k',
            ...     io.BytesIO(b'bla')
            ... )
            {'Hash': 'QmSw3k2qkv4ZPsbu9DVEJaTMszAQWNgM1FTFYpfZeNQWrd'}

        Parameters
        ----------
        root : str
            IPFS hash of the object to modify
        data : io.RawIOBase
            The new data to store in root

        Returns
        -------
            dict : Hash of new object
        """
        args = (root,)
        body, headers = multipart.stream_files(data, self.chunk_size)
        return self._client.request('/object/patch/set-data', args,
                                    decoder='json',
                                    data=body, headers=headers, **kwargs)