def _compile(pathname, timestamp):
    codestring = open(pathname, 'rU').read()
    if codestring and codestring[-1] != '\n':
        codestring = codestring + '\n'
    code = __builtin__.compile(codestring, pathname, 'exec')

    # try to cache the compiled code
    try:
        f = open(pathname + _suffix_char, 'wb')
    except IOError:
        pass
    else:
        f.write('\0\0\0\0')
        f.write(struct.pack('<I', timestamp))
        marshal.dump(code, f)
        f.flush()
        f.seek(0, 0)
        f.write(imp.get_magic())
        f.close()

    return code
Checks that the content of a file is different to the reference.
dataset/ETHPy150Open anandology/pyjamas/pyjd/imputil.py/_compile--crossover with--dataset/ETHPy150Open ganeti/ganeti/test/py/testutils/__init__.py/GanetiTestCase.assertFileContentNotEqual