<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean_perms(self):
 """FAB leaves faulty permissions that need to be cleaned up"""

        logging.info('Cleaning faulty perms')
        sesh = self.get_session
        pvms = (
            sesh.query(ab_models.PermissionView)
            .filter(or_(
                ab_models.PermissionView.permission == None,  # NOQA
                ab_models.PermissionView.view_menu == None,  # NOQA
            ))
        )
        deleted_count = pvms.delete()
        sesh.commit()
        if deleted_count:
            logging.info('Deleted {} faulty permissions'.format(deleted_count))