<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_basic_mesh(Verts, E2V=None, mesh_type='tri', pdata=None, pvdata=None, cdata=None, cvdata=None, fname='output.vtk'):
 """Write mesh file for basic types of elements. Parameters fname : {string} file to be written, e.g. 'mymesh.vtu' Verts : {array} coordinate array (N x D) E2V : {array} element index array (Nel x Nelnodes) mesh_type : {string} type of elements: tri, quad, tet, hex (all 3d) pdata : {array} scalar data on vertices (N x Nfields) pvdata : {array} vector data on vertices (3*Nfields x N) cdata : {array} scalar data on cells (Nfields x Nel) cvdata : {array} vector data on cells (3*Nfields x Nel) Returns ------- writes a .vtu file for use in Paraview Notes ----- The difference between write_basic_mesh and write_vtu is that write_vtu is more general and requires dictionaries of cell information. write_basic_mesh calls write_vtu Examples -------- pvdata=pvdata, cdata=cdata, cvdata=cvdata, fname='test.vtu') See Also -------- write_vtu """

    if E2V is None:
        mesh_type = 'vertex'

    map_type_to_key = {'vertex': 1, 'tri': 5, 'quad': 9, 'tet': 10, 'hex': 12}

    if mesh_type not in map_type_to_key:
        raise ValueError('unknown mesh_type=%s' % mesh_type)

    key = map_type_to_key[mesh_type]

    if mesh_type == 'vertex':
        uidx = np.arange(0, Verts.shape[0]).reshape((Verts.shape[0], 1))
        E2V = {key: uidx}
    else:
        E2V = {key: E2V}

    if cdata is not None:
        cdata = {key: cdata}

    if cvdata is not None:
        cvdata = {key: cvdata}

    write_vtu(Verts=Verts, Cells=E2V, pdata=pdata, pvdata=pvdata,
              cdata=cdata, cvdata=cvdata, fname=fname)