def folder(self, name, parentId, parentType, description=None,
               public=True, folders=None, access=None, debug=False):

        ret = {}

        assert ['collection', 'folder', 'user'] in parentType, \
            "parentType must be collection or folder"

        r = FolderResource(self, parentType, parentId)
        valid_fields = [("name", name),
                        ("description", description),
                        ("parentType", parentType),
                        ("parentId", parentId)]

        if self.module.params['state'] == 'present':
            if r.name_exists(name):
                ret = r.update_by_name(name, {k: v for k, v in valid_fields
                                              if v is not None})
            else:
                valid_fields = valid_fields + [("public", public)]
                ret = r.create({k: v for k, v in valid_fields
                                if v is not None})

            if folders is not None:
                self._process_folders(folders, ret["_id"], "folder")

            # handle access here
            if access is not None:
                _id = ret['_id']
                ret['access'] = self._access(r, access, _id, public=public)

        elif self.module.params['state'] == 'absent':
            ret = r.delete_by_name(name)

        return ret
dataset/ETHPy150Open girder/girder/clients/ansible/girder.py/GirderClientModule.folder/swapped operands of `in`