nodes: 0, module; 1, function_definition; 2, function_name:iter_milestones; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, for_statement; 16, if_statement; 17, return_statement; 18, identifier:state; 19, None; 20, identifier:sort; 21, None; 22, identifier:direction; 23, None; 24, identifier:number; 25, unary_operator; 26, identifier:etag; 27, None; 28, comment:"""Iterates over the milestones on this repository.
  
          :param str state: (optional), state of the milestones, accepted
              values: ('open', 'closed')
          :param str sort: (optional), how to sort the milestones, accepted
              values: ('due_date', 'completeness')
          :param str direction: (optional), direction to sort the milestones,
              accepted values: ('asc', 'desc')
          :param int number: (optional), number of milestones to return.
              Default: -1 returns all milestones
          :param str etag: (optional), ETag from a previous request to the same
              endpoint
          :returns: generator of
              :class:`Milestone <github3.issues.milestone.Milestone>`\ s
          """; 29, assignment; 30, assignment; 31, assignment; 32, tuple_pattern; 33, call; 34, block; 35, not_operator; 36, block; 37, call; 38, integer:1; 39, identifier:url; 40, call; 41, identifier:accepted; 42, dictionary; 43, identifier:params; 44, dictionary; 45, identifier:k; 46, identifier:v; 47, identifier:list; 48, argument_list; 49, if_statement; 50, identifier:params; 51, expression_statement; 52, attribute; 53, argument_list; 54, attribute; 55, argument_list; 56, pair; 57, pair; 58, pair; 59, pair; 60, pair; 61, pair; 62, call; 63, not_operator; 64, comment:# e.g., '' or None; 65, block; 66, assignment; 67, identifier:self; 68, identifier:_iter; 69, call; 70, identifier:url; 71, identifier:Milestone; 72, identifier:params; 73, identifier:etag; 74, identifier:self; 75, identifier:_build_url; 76, string; 77, keyword_argument; 78, string; 79, tuple; 80, string; 81, tuple; 82, string; 83, tuple; 84, string; 85, identifier:state; 86, string; 87, identifier:sort; 88, string; 89, identifier:direction; 90, attribute; 91, argument_list; 92, parenthesized_expression; 93, delete_statement; 94, identifier:params; 95, None; 96, identifier:int; 97, argument_list; 98, string_content:milestones; 99, identifier:base_url; 100, attribute; 101, string_content:state; 102, string; 103, string; 104, string_content:sort; 105, string; 106, string; 107, string_content:direction; 108, string; 109, string; 110, string_content:state; 111, string_content:sort; 112, string_content:direction; 113, identifier:params; 114, identifier:items; 115, boolean_operator; 116, subscript; 117, identifier:number; 118, identifier:self; 119, identifier:_api; 120, string_content:open; 121, string_content:closed; 122, string_content:due_date; 123, string_content:completeness; 124, string_content:asc; 125, string_content:desc; 126, identifier:v; 127, parenthesized_expression; 128, identifier:params; 129, identifier:k; 130, comparison_operator:v in accepted[k]; 131, identifier:v; 132, subscript; 133, identifier:accepted; 134, identifier:k
code: def iter_milestones(self, state=None, sort=None, direction=None,
                          number=-1, etag=None):
          """Iterates over the milestones on this repository.
  
          :param str state: (optional), state of the milestones, accepted
              values: ('open', 'closed')
          :param str sort: (optional), how to sort the milestones, accepted
              values: ('due_date', 'completeness')
          :param str direction: (optional), direction to sort the milestones,
              accepted values: ('asc', 'desc')
          :param int number: (optional), number of milestones to return.
              Default: -1 returns all milestones
          :param str etag: (optional), ETag from a previous request to the same
              endpoint
          :returns: generator of
              :class:`Milestone <github3.issues.milestone.Milestone>`\ s
          """
          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])):  # e.g., '' or None
                  del params[k]
          if not params:
              params = None
          return self._iter(int(number), url, Milestone, params, etag)