'Get the counts of InstanceGroup objects in the database.
:param context: The request context for database access
:param project_id: The project_id to count across
:param user_id: The user_id to count across
:returns: A dict containing the project-scoped counts and user-scoped
counts if user_id is specified. For example:
{\'project\': {\'server_groups\': <count across project>},
\'user\': {\'server_groups\': <count across user>}}'

@base.remotable_classmethod
def get_counts(cls, context, project_id, user_id=None):

    return cls._get_counts_from_db(context, project_id, user_id=user_id)
