def METHOD_NAME(toas, format="tempo2", **kwargs):
    f = StringIO()
    toas.write_TOA_file(f, format=format)
    toas_2 = get_TOAs(StringIO(f.getvalue()), **kwargs)
    # assert toas.commands == toas_2.commands
    assert toas.ntoas == toas_2.ntoas
    assert all(
        abs(x) < 1 * u.ns
        for x in (
            toas.get_mjds(high_precision=True) - toas_2.get_mjds(high_precision=True)
        )
    )
    assert np.all(toas.get_freqs() == toas_2.get_freqs())
    assert (
        abs(toas.get_errors() - toas_2.get_errors()).max() < 1 * u.ns
    )  # this is weirdly large because we don't record many decimal places
    assert np.all(toas.get_obss() == toas_2.get_obss())
    assert np.all(toas.get_pulse_numbers() == toas_2.get_pulse_numbers())
    assert np.all(toas.get_flags() == toas_2.get_flags())
    return toas_2