def create_milestone(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet):
assert isinstance(title, (str, unicode)), title<EOL>assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state<EOL>assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description<EOL>assert due_on is github.GithubObject.NotSet or isinstance(due_on, (datetime.datetime, datetime.date)), due_on<EOL>post_parameters = {<EOL>"<STR_LIT:title>": title,<EOL>}<EOL>if state is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT:state>"] = state<EOL><DEDENT>if description is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT:description>"] = description<EOL><DEDENT>if due_on is not github.GithubObject.NotSet:<EOL><INDENT>if isinstance(due_on, datetime.date):<EOL><INDENT>post_parameters["<STR_LIT>"] = due_on.strftime("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>post_parameters["<STR_LIT>"] = due_on.isoformat()<EOL><DEDENT><DEDENT>headers, data = self._requester.requestJsonAndCheck(<EOL>"<STR_LIT:POST>",<EOL>self.url + "<STR_LIT>",<EOL>input=post_parameters<EOL>)<EOL>return github.Milestone.Milestone(self._requester, headers, data, completed=True)<EOL>
:calls: `POST /repos/:owner/:repo/milestones <http://developer.github.com/v3/issues/milestones>`_
:param title: string
:param state: string
:param description: string
:param due_on: datetime
:rtype: :class:`github.Milestone.Milestone`