ab9247bdf8b7a3decc34a15b26fec813ea8fba0d,scanpy/readwrite.py,,_download,#Any#Any#,917

Before Change


                    t.total = tsize
                t.update(b * bsize - t.n)

            headers = resp.info()
            // This capitalization was copied from the stdlib too
            if "content-length" in headers:
                size = int(headers["Content-Length"])

            update_to(blocknum, bs, size)
            while True:
                block = resp.read(bs)
                if not block:
                    break
                read += len(block)
                f.write(block)
                blocknum += 1
                update_to(blocknum, bs, size)
        // fmt: on

After Change


            path.open("wb") as f, \
            urlopen(Request(url, headers={"User-agent": "scanpy-user"})) as resp:

            t.total = int(resp.info().get("content-length", 0))

            block = resp.read(blocksize)
            while block:
                f.write(block)
                blocknum += 1
                t.update(blocknum * blocksize - t.n)
                block = resp.read(blocksize)
        // fmt: on
    except Exception:
        // Make sure file doesn’t exist half-downloaded
        if path.is_file():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: theislab/scanpy
Commit Name: ab9247bdf8b7a3decc34a15b26fec813ea8fba0d
Time: 2020-07-31
Author: ivirshup@gmail.com
File Name: scanpy/readwrite.py
Class Name:
Method Name: _download


Project Name: brian-team/brian2
Commit Name: 81ac05cfd756e6c43261660b5c6bfb44703ebe36
Time: 2015-03-02
Author: marcel.stimberg@inserm.fr
File Name: brian2/stateupdaters/base.py
Class Name: StateUpdateMethod
Method Name: determine_stateupdater


Project Name: Qiskit/qiskit-aqua
Commit Name: cfa2566a4e464b2ad1c22cf179dd8e0045d1dbb0
Time: 2018-10-01
Author: manoel@us.ibm.com
File Name: qiskit_aqua/quantumalgorithm.py
Class Name: QuantumAlgorithm
Method Name: register_and_get_operational_backends