'Returns a boolean whether a particular query should trigger an application
of inherited metadata onto the item'

def _should_apply_cached_metadata(self, item, depth):

    category = item['location']['category']
    apply_cached_metadata = ((category not in DETACHED_XBLOCK_TYPES) and (not ((category == 'course') and (depth == 0))))
    return apply_cached_metadata
