code: def iter_milestones(self, state=None, sort=None, direction=None,
                          number=-1, etag=None):
          url = self._build_url('milestones', base_url=self._api)
          accepted = {'state': ('open', 'closed'),
                      'sort': ('due_date', 'completeness'),
                      'direction': ('asc', 'desc')}
          params = {'state': state, 'sort': sort, 'direction': direction}
          for (k, v) in list(params.items()):
              if not (v and (v in accepted[k])):
                  del params[k]
          if not params:
              params = None
          return self._iter(int(number), url, Milestone, params, etag)