def remove(self, item, **kwargs):

        # Delete all files in this item
        files = self.model('file').find({
            'itemId': item['_id']
        })
        for file in files:
            fileKwargs = kwargs.copy()
            fileKwargs.pop('updateItemSize', None)
            self.model('file').remove(file, updateItemSize=False, **fileKwargs)

        # Delete pending uploads into this item
        uploads = self.model('upload').find({
            'parentId': item['_id'],
            'parentType': 'item'
        })
        for upload in uploads:
            self.model('upload').remove(upload, **kwargs)

        # Delete the item itself
        Model.remove(self, item)
Recursive lightcasting function
dataset/ETHPy150Open girder/girder/girder/models/item.py/Item.remove--crossover with--dataset/ETHPy150Open tuturto/pyherc/src/pyherc/rules/los.py/cast_light