def resolve_invite(invite):
from .invite import Invite  <EOL>if isinstance(invite, Invite) or isinstance(invite, Object):<EOL><INDENT>return invite.id<EOL><DEDENT>else:<EOL><INDENT>rx = r'<STR_LIT>'<EOL>m = re.match(rx, invite)<EOL>if m:<EOL><INDENT>return m.group(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>return invite<EOL>
Resolves an invite from a :class:`Invite`, URL or ID

Parameters
-----------
invite: Union[:class:`Invite`, :class:`Object`, :class:`str`]
    The invite.

Returns
--------
:class:`str`
    The invite code.