Writes a shebang to the first line of the file according to the specified
    version. (2 | 3 | default)

def put_shebang(f, version):
    """
    Writes a shebang to the first line of the file according to the specified
    version. (2 | 3 | default)
    """
    if not contains_shebang(f):
        f.seek(0)
        original_text = f.read()
        f.seek(0)
        f.write(shebangs[version] + original_text)