'Helper function for setting of flags.
Arguments:
flags -- Flags in dictionary format: { "flag name": "flag value" ... }'

def _set_flags(self, flags):

    for f in self._flags:
        if ((flags is not None) and (f in flags)):
            self[f] = flags[f]
        else:
            self[f] = None
