<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fexist(self, fields):
 """Check if a vdata contains a given set of fields. Args:: fields sequence of field names whose presence in the vdata must be checked Returns:: true (1) if the given fields are present false (0) otherwise C library equivalent : VSfexist """


        if type(fields) in [tuple, list]:
            str = ','.join(fields)
        else:
            str = fields
        ret = _C.VSfexist(self._id, str)
        if ret < 0:
            return 0
        else:
            return 1