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]

    assert values[0] == values[1]
    assert values[1] == values[2].replace(b"\r\n", b"\n")
    for buffer in buffers:
        buffer.close()


def test_patheffects():
    with matplotlib.rc_context():
        matplotlib.rcParams["path.effects"] = [
            patheffects.withStroke(linewidth=4, foreground="w")]

After Change


        fig.savefig(b_buf, format=format)

        s_val = s_buf.getvalue().encode("ascii")
        b_val = b_buf.getvalue()

        // 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]]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

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: GoogleCloudPlatform/python-docs-samples
Commit Name: 39dab6b98c276ed9abfa91ee519493379caf5c4a
Time: 2015-09-15
Author: jon.wayne.parrott@gmail.com
File Name: bigquery/tests/test_sync_query.py
Class Name: TestSyncQuery
Method Name: test_sync_query


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 39dab6b98c276ed9abfa91ee519493379caf5c4a
Time: 2015-09-15
Author: jon.wayne.parrott@gmail.com
File Name: bigquery/tests/test_async_query.py
Class Name: TestAsyncQuery
Method Name: test_async_query


Project Name: estnltk/estnltk
Commit Name: cf5f38373ec0a08518dae7051e53e44c316c166c
Time: 2015-07-28
Author: karl.valliste@gmail.com
File Name: estnltk/prettyprinter/prettyprinter.py
Class Name: PrettyPrinter
Method Name: render