<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(self, name, fields):
 """Create a new vdata, setting its name and allocating its fields. Args:: name Name to assign to the vdata fields Sequence of field definitions. Each field definition is a sequence with the following elements in order: - field name - field type (one of HC.xxx constants) - field order (number of values) Fields are allocated to the vdata in the given order Returns:: VD instance representing the created vdata Calling the create() method is equivalent to the following calls: - vd = attach(-1,1), to create a new vdata and open it in write mode - vd._name = name, to set the vdata name each field C library equivalent : no equivalent """


        try:
            # Create new vdata (-1), open in write mode (1)
            vd = self.attach(-1, 1)
            # Set vdata name
            vd._name = name
            # Define fields
            allNames = []
            for name, type, order in fields:
                vd.fdefine(name, type, order)
                allNames.append(name)
            # Allocate fields to the vdata
            vd.setfields(*allNames)
            return vd
        except HDF4Error as msg:
            raise HDF4Error("error creating vdata (%s)" % msg)