39fb7b5b96ea46aca94099d166106365eaf0647e,lib/matplotlib/tests/test_backend_ps.py,,test_savefig_to_stringio,#Any#Any#Any#,49

Before Change


    matplotlib.rcParams.update(rcParams)

    fig, ax = plt.subplots()
    buffers = [
        six.moves.StringIO(),
        io.StringIO(),
        io.BytesIO()]

    if use_log:
        ax.set_yscale("log")

    ax.plot([1, 2], [1, 2])
    ax.set_title(u"Déjà vu")
    for buffer in buffers:
        fig.savefig(buffer, format=format)

    values = [x.getvalue() for x in buffers]

    if six.PY3:
        values = [
            values[0].encode("ascii"),
            values[1].encode("ascii"),
            values[2]]

    // Remove comments from the output.  This includes things that
    // could change from run to run, such as the time.
    values = [re.sub(b"%%.*?\n", b"", x) for x in values]

After Change



        // Remove comments from the output.  This includes things that could
        // change from run to run, such as the time.
        s_val, b_val = [re.sub(b"%%.*?\n", b"", x) for x in [s_val, b_val]]

        assert s_val == b_val.replace(b"\r\n", b"\n")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: matplotlib/matplotlib
Commit Name: 39fb7b5b96ea46aca94099d166106365eaf0647e
Time: 2018-03-08
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/tests/test_backend_ps.py
Class Name:
Method Name: test_savefig_to_stringio


Project Name: biocore/scikit-bio
Commit Name: 8b59737afbb277ee3bf52bec79f4fc7c5a086642
Time: 2015-06-25
Author: ebolyen@gmail.com
File Name: skbio/tree/_tree.py
Class Name: TreeNode
Method Name: __str__


Project Name: uber/petastorm
Commit Name: 6e127316edc8118049ca29ff94e2f4c6d34580dc
Time: 2018-07-31
Author: selitvin@users.noreply.github.com
File Name: petastorm/codecs.py
Class Name: CompressedImageCodec
Method Name: encode