<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def file_mode(self):
 """onefile, fpp, or both"""

        fms = self.attributes['file_mode']
        eax = set()
        if isinstance(fms, six.string_types):
            fms = shlex.split(fms)
        for fm in fms:
            if fm == 'both':
                eax.add('fpp')
                eax.add('onefile')
            elif fm in ['fpp', 'onefile']:
                eax.add(fm)
            else:
                raise Exception('Invalid IOR file mode: ' + fm)
        return eax