<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_vasp(filename, cell, direct=True):
 """Write crystal structure to a VASP POSCAR style file. Parameters filename : str Filename. cell : PhonopyAtoms Crystal structure. direct : bool, optional In 'Direct' or not in VASP POSCAR format. Default is True. """


    lines = get_vasp_structure_lines(cell, direct=direct)
    with open(filename, 'w') as w:
        w.write("\n".join(lines))