def NamedTemporaryFile23(*args, **kwargs):
    if sys.version_info[0] == 2:  # Python 2
        kwargs.pop('encoding', None)
    return NamedTemporaryFile(*args, **kwargs)
Works exactly as a wrapper to tempfile.NamedTemporaryFile except that
dataset/ETHPy150Open machinalis/iepy/tests/factories.py/NamedTemporaryFile23