def create_membership(self, user, **kwargs):
from canvasapi.user import User<EOL>user_id = obj_or_id(user, "<STR_LIT:user>", (User,))<EOL>response = self._requester.request(<EOL>'<STR_LIT:POST>',<EOL>'<STR_LIT>'.format(self.id),<EOL>user_id=user_id,<EOL>_kwargs=combine_kwargs(**kwargs)<EOL>)<EOL>return GroupMembership(self._requester, response.json())<EOL>
Join, or request to join, a group, depending on the join_level of the group.
If the membership or join request already exists, then it is simply returned.

:calls: `POST /api/v1/groups/:group_id/memberships \
<https://canvas.instructure.com/doc/api/groups.html#method.group_memberships.create>`_

:param user: The object or ID of the user.
:type user: :class:`canvasapi.user.User` or int

:rtype: :class:`canvasapi.group.GroupMembership`