def pull_blob(self, digest, size=False, chunk_size=None):
if chunk_size is None:<EOL><INDENT>chunk_size = <NUM_LIT><EOL><DEDENT>r = self._request('<STR_LIT>', '<STR_LIT>' + digest, stream=True)<EOL>class Chunks(object):<EOL><INDENT>def __iter__(self):<EOL><INDENT>sha256 = hashlib.sha256()<EOL>for chunk in r.iter_content(chunk_size):<EOL><INDENT>sha256.update(chunk)<EOL>yield chunk<EOL><DEDENT>dgst = '<STR_LIT>' + sha256.hexdigest()<EOL>if dgst != digest:<EOL><INDENT>raise exceptions.DXFDigestMismatchError(dgst, digest)<EOL><DEDENT><DEDENT><DEDENT>return (Chunks(), long(r.headers['<STR_LIT>'])) if size else Chunks()<EOL>
Download a blob from the registry given the hash of its content.

:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str

:param size: Whether to return the size of the blob too.
:type size: bool

:param chunk_size: Number of bytes to download at a time. Defaults to 8192.
:type chunk_size: int

:rtype: iterator
:returns: If ``size`` is falsey, a byte string iterator over the blob's content. If ``size`` is truthy, a tuple containing the iterator and the blob's size.