def write_to(self, fp):
if '<STR_LIT:b>' not in fp.mode:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>response = self._get(self._download_url, stream=True)<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>response.raw.decode_content = True<EOL>copyfileobj(response.raw, fp,<EOL>int(response.headers['<STR_LIT>']))<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError("<STR_LIT>"<EOL>"<STR_LIT>".format(response.status_code))<EOL><DEDENT>
Write contents of this file to a local file.

        Pass in a filepointer `fp` that has been opened for writing in
        binary mode.