def dict_add(self, key, nestedKey, value, type="string"):
        '''
        '''
        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.")
        if not nestedKey:
            raise ValueError("Dictionaries require inner keys.")
        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), '-dict-add', str(nestedKey), option, str(value)])
dataset/ETHPy150Open univ-of-utah-marriott-library-apple/management_tools/management_tools/plist_editor.py/PlistEditor.dict_add/swapped operands of `in`