def add_to_collaborators(self, collaborator, permission=github.GithubObject.NotSet):
assert isinstance(collaborator, github.NamedUser.NamedUser) or isinstance(collaborator, (str, unicode)), collaborator<EOL>assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission<EOL>if isinstance(collaborator, github.NamedUser.NamedUser):<EOL><INDENT>collaborator = collaborator._identity<EOL><DEDENT>if permission is not github.GithubObject.NotSet:<EOL><INDENT>put_parameters = {'<STR_LIT>': permission}<EOL><DEDENT>else:<EOL><INDENT>put_parameters = None<EOL><DEDENT>headers, data = self._requester.requestJsonAndCheck(<EOL>"<STR_LIT>",<EOL>self.url + "<STR_LIT>" + collaborator,<EOL>input=put_parameters<EOL>)<EOL>return github.Invitation.Invitation(self._requester, headers, data, completed=True) ifdata is not None else None<EOL>
:calls: `PUT /repos/:owner/:repo/collaborators/:user <http://developer.github.com/v3/repos/collaborators>`_
:param collaborator: string or :class:`github.NamedUser.NamedUser`
:param permission: string 'pull', 'push' or 'admin'
:rtype: None