<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_milestone(self, title):
 """ given the title as str, looks for an existing milestone or create a new one, and return the object """

        if not title:
            return GithubObject.NotSet
        if not hasattr(self, '_milestones'):
            self._milestones = {m.title: m for m in self.repo.get_milestones()}

        milestone = self._milestones.get(title)
        if not milestone:
            milestone = self.repo.create_milestone(title=title)
        return milestone