def write(self, key, value, type="string"):
        '''Writes the specified value to the specified key in a given type.  If
        no type is given, the default is 'string'.  Returns the exit code of the
        defaults command.

        key   -- the key to write to
        value -- the value to put in the key
        type  -- the type of value (boolean, integer, etc.)
        '''
        if not os.access(self.path, os.W_OK):
            raise IOError(".plist file '" + self.path + "' is not writable.")
        if not key:
            raise ValueError("Must provide a key.")
        valids = ['string', 'data', 'int', 'integer', 'float', 'bool', 'boolean', 'data', 'array', 'array-add', 'dict', 'dict-add']
        if not valids in type:
            raise ValueError("Type not valid.  Must be one of " + str(valids))
        elif type == 'array':
            option = '-array-add'
        elif type == 'dict':
            option = '-dict-add'
        else:
            option = '-' + type
        return subprocess.call(['defaults', 'write', self.list, str(key), option, str(value)])
dataset/ETHPy150Open univ-of-utah-marriott-library-apple/management_tools/management_tools/plist_editor.py/PlistEditor.write/swapped operands of `in`