def _getBaseResource(self, model, resource):
        """
        Get the base resource for something pertaining to quota policies.  If
        the base resource has no quota policy, return (None, None).

        :param model: the initial model type.  Could be file, item, folder,
                      user, or collection.
        :param resource: the initial resource document.
        :returns: A pair ('model', 'resource'), where 'model' is the base model
                 type, either 'user' or 'collection'., and 'resource' is the
                 base resource document or the id of that document.
        """
        if isinstance(resource, tuple(list(six.string_types) + [ObjectId])):
            resource = self.model(model).load(id=resource, force=True)
        if model == 'file':
            model = 'item'
            resource = self.model('item').load(id=resource['itemId'],
                                               force=True)
        if model in ('folder', 'item'):
            if ('baseParentType' not in resource or
                    'baseParentId' not in resource):
                resource = self.model(model).load(id=resource['_id'],
                                                  force=True)
            if ('baseParentType' not in resource or
                    'baseParentId' not in resource):
                return None, None
            model = resource['baseParentType']
            resourceId = resource['baseParentId']
            resource = self.model(model).load(id=resourceId, force=True)
        if model in ('user', 'collection') and resource:
            # Ensure the base resource has a quota field so we can use the
            # default quota if apropriate
            if QUOTA_FIELD not in resource:
                resource[QUOTA_FIELD] = {}
        if not resource or resource not in QUOTA_FIELD:
            return None, None
        return model, resource
dataset/ETHPy150Open girder/girder/plugins/user_quota/server/quota.py/QuotaPolicy._getBaseResource/swapped operands of `not in`