@classmethod<EOL><INDENT>def create(cls, name=None, description='<STR_LIT>', privacy_policy=None,<EOL>subscription_policy=None, is_managed=False, admins=None):<DEDENT>
assert name<EOL>assert privacy_policy is None or PrivacyPolicy.validate(privacy_policy)<EOL>assert subscription_policy is None orSubscriptionPolicy.validate(subscription_policy)<EOL>assert admins is None or isinstance(admins, list)<EOL>with db.session.begin_nested():<EOL><INDENT>obj = cls(<EOL>name=name,<EOL>description=description,<EOL>privacy_policy=privacy_policy,<EOL>subscription_policy=subscription_policy,<EOL>is_managed=is_managed,<EOL>)<EOL>db.session.add(obj)<EOL>for a in admins or []:<EOL><INDENT>db.session.add(GroupAdmin(<EOL>group=obj, admin_id=a.get_id(),<EOL>admin_type=resolve_admin_type(a)))<EOL><DEDENT><DEDENT>return obj<EOL>
Create a new group.

        :param name: Name of group. Required and must be unique.
        :param description: Description of group. Default: ``''``
        :param privacy_policy: PrivacyPolicy
        :param subscription_policy: SubscriptionPolicy
        :param admins: list of user and/or group objects. Default: ``[]``
        :returns: Newly created group
        :raises: IntegrityError: if group with given name already exists