'Return the number of stacks that match the given filters.
:param cnxt: RPC context.
:param filters: a dict of ATTR:VALUE to match against stacks
:param tenant_safe: DEPRECATED, if true, scope the request by
the current tenant
:param show_deleted: if true, count will include the deleted stacks
:param show_nested: if true, count will include nested stacks
:param show_hidden: if true, count will include hidden stacks
:param tags: count stacks containing these tags. If multiple tags
are passed, they will be combined using the boolean AND expression
:param tags_any: count stacks containing these tags. If multiple tags
are passed, they will be combined using the boolean OR expression
:param not_tags: count stacks not containing these tags. If multiple
tags are passed, they will be combined using the boolean AND
expression
:param not_tags_any: count stacks not containing these tags. If
multiple tags are passed, they will be combined using the boolean
OR expression
:returns: an integer representing the number of matched stacks'

@context.request_context
def count_stacks(self, cnxt, filters=None, tenant_safe=True, show_deleted=False, show_nested=False, show_hidden=False, tags=None, tags_any=None, not_tags=None, not_tags_any=None):

    if (not tenant_safe):
        cnxt = context.get_admin_context()
    return stack_object.Stack.count_all(cnxt, filters=filters, show_deleted=show_deleted, show_nested=show_nested, show_hidden=show_hidden, tags=tags, tags_any=tags_any, not_tags=not_tags, not_tags_any=not_tags_any)
