nodes: 0, module; 1, function_definition; 2, function_name:get_milestones; 3, parameters; 4, block; 5, default_parameter; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, expression_statement; 16, expression_statement; 17, if_statement; 18, comment:# Only pass the following API args if they're not the defaults listed.; 19, if_statement; 20, if_statement; 21, if_statement; 22, expression_statement; 23, expression_statement; 24, for_statement; 25, return_statement; 26, identifier:repo_name; 27, None; 28, identifier:profile; 29, string; 30, identifier:state; 31, string; 32, identifier:sort; 33, string; 34, identifier:direction; 35, string; 36, identifier:output; 37, string; 38, identifier:per_page; 39, None; 40, string; 41, assignment; 42, comparison_operator:repo_name is None; 43, block; 44, assignment; 45, assignment; 46, identifier:per_page; 47, block; 48, boolean_operator; 49, block; 50, boolean_operator; 51, block; 52, boolean_operator; 53, block; 54, assignment; 55, assignment; 56, identifier:milestone; 57, identifier:milestones; 58, block; 59, identifier:ret; 60, string_content:github; 61, string_content:open; 62, string_content:due_on; 63, string_content:asc; 64, string_content:min; 65, string_content:Return information about milestones for a given repository.
  
      .. versionadded:: 2016.11.0
  
      repo_name
          The name of the repository for which to list issues. This argument is
          required, either passed via the CLI, or defined in the configured
          profile. A ``repo_name`` passed as a CLI argument will override the
          repo_name defined in the configured profile, if provided.
  
      profile
          The name of the profile configuration to use. Defaults to ``github``.
  
      state
          The state of the milestone. Either ``open``, ``closed``, or ``all``.
          Default is ``open``.
  
      sort
          What to sort results by. Either ``due_on`` or ``completeness``. Default
          is ``due_on``.
  
      direction
          The direction of the sort. Either ``asc`` or ``desc``. Default is ``asc``.
  
      output
          The amount of data returned by each issue. Defaults to ``min``. Change
          to ``full`` to see all issue output.
  
      per_page
          GitHub paginates data in their API calls. Use this value to increase or
          decrease the number of issues gathered from GitHub, per page. If not set,
          GitHub defaults are used.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion github.get_milestones; 66, identifier:org_name; 67, call; 68, identifier:repo_name; 69, None; 70, expression_statement; 71, identifier:action; 72, call; 73, identifier:args; 74, dictionary; 75, expression_statement; 76, identifier:state; 77, comparison_operator:state != 'open'; 78, expression_statement; 79, identifier:sort; 80, comparison_operator:sort != 'due_on'; 81, expression_statement; 82, identifier:direction; 83, comparison_operator:direction != 'asc'; 84, expression_statement; 85, identifier:ret; 86, dictionary; 87, identifier:milestones; 88, call; 89, expression_statement; 90, if_statement; 91, identifier:_get_config_value; 92, argument_list; 93, assignment; 94, attribute; 95, argument_list; 96, assignment; 97, identifier:state; 98, string; 99, assignment; 100, identifier:sort; 101, string; 102, assignment; 103, identifier:direction; 104, string; 105, assignment; 106, identifier:_query; 107, argument_list; 108, assignment; 109, comparison_operator:output == 'full'; 110, block; 111, else_clause; 112, identifier:profile; 113, string; 114, identifier:repo_name; 115, call; 116, string; 117, identifier:join; 118, list; 119, subscript; 120, identifier:per_page; 121, string_content:open; 122, subscript; 123, identifier:state; 124, string_content:due_on; 125, subscript; 126, identifier:sort; 127, string_content:asc; 128, subscript; 129, identifier:direction; 130, identifier:profile; 131, keyword_argument; 132, keyword_argument; 133, keyword_argument; 134, identifier:milestone_id; 135, call; 136, identifier:output; 137, string; 138, expression_statement; 139, block; 140, string_content:org_name; 141, identifier:_get_config_value; 142, argument_list; 143, string_content:/; 144, string; 145, identifier:org_name; 146, identifier:repo_name; 147, identifier:args; 148, string; 149, identifier:args; 150, string; 151, identifier:args; 152, string; 153, identifier:args; 154, string; 155, identifier:action; 156, identifier:action; 157, identifier:command; 158, string; 159, identifier:args; 160, identifier:args; 161, attribute; 162, argument_list; 163, string_content:full; 164, assignment; 165, expression_statement; 166, expression_statement; 167, expression_statement; 168, expression_statement; 169, identifier:profile; 170, string; 171, string_content:repos; 172, string_content:per_page; 173, string_content:state; 174, string_content:sort; 175, string_content:direction; 176, string_content:milestones; 177, identifier:milestone; 178, identifier:get; 179, string; 180, subscript; 181, identifier:milestone; 182, call; 183, call; 184, call; 185, assignment; 186, string_content:repo_name; 187, string_content:id; 188, identifier:ret; 189, identifier:milestone_id; 190, attribute; 191, argument_list; 192, attribute; 193, argument_list; 194, attribute; 195, argument_list; 196, subscript; 197, identifier:milestone; 198, identifier:milestone; 199, identifier:pop; 200, string; 201, identifier:milestone; 202, identifier:pop; 203, string; 204, identifier:milestone; 205, identifier:pop; 206, string; 207, identifier:ret; 208, identifier:milestone_id; 209, string_content:creator; 210, string_content:html_url; 211, string_content:labels_url
code: def get_milestones(repo_name=None,
                     profile='github',
                     state='open',
                     sort='due_on',
                     direction='asc',
                     output='min',
                     per_page=None):
      '''
      Return information about milestones for a given repository.
  
      .. versionadded:: 2016.11.0
  
      repo_name
          The name of the repository for which to list issues. This argument is
          required, either passed via the CLI, or defined in the configured
          profile. A ``repo_name`` passed as a CLI argument will override the
          repo_name defined in the configured profile, if provided.
  
      profile
          The name of the profile configuration to use. Defaults to ``github``.
  
      state
          The state of the milestone. Either ``open``, ``closed``, or ``all``.
          Default is ``open``.
  
      sort
          What to sort results by. Either ``due_on`` or ``completeness``. Default
          is ``due_on``.
  
      direction
          The direction of the sort. Either ``asc`` or ``desc``. Default is ``asc``.
  
      output
          The amount of data returned by each issue. Defaults to ``min``. Change
          to ``full`` to see all issue output.
  
      per_page
          GitHub paginates data in their API calls. Use this value to increase or
          decrease the number of issues gathered from GitHub, per page. If not set,
          GitHub defaults are used.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion github.get_milestones
  
      '''
      org_name = _get_config_value(profile, 'org_name')
      if repo_name is None:
          repo_name = _get_config_value(profile, 'repo_name')
  
      action = '/'.join(['repos', org_name, repo_name])
      args = {}
  
      if per_page:
          args['per_page'] = per_page
  
      # Only pass the following API args if they're not the defaults listed.
      if state and state != 'open':
          args['state'] = state
      if sort and sort != 'due_on':
          args['sort'] = sort
      if direction and direction != 'asc':
          args['direction'] = direction
  
      ret = {}
      milestones = _query(profile, action=action, command='milestones', args=args)
  
      for milestone in milestones:
          milestone_id = milestone.get('id')
          if output == 'full':
              ret[milestone_id] = milestone
          else:
              milestone.pop('creator')
              milestone.pop('html_url')
              milestone.pop('labels_url')
              ret[milestone_id] = milestone
  
      return ret