nodes: 0, module; 1, function_definition; 2, function_name:get_issues; 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, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, default_parameter; 18, expression_statement; 19, expression_statement; 20, if_statement; 21, expression_statement; 22, expression_statement; 23, comment:# Build API arguments, as necessary.; 24, if_statement; 25, if_statement; 26, if_statement; 27, if_statement; 28, if_statement; 29, if_statement; 30, if_statement; 31, comment:# Only pass the following API args if they're not the defaults listed.; 32, if_statement; 33, if_statement; 34, if_statement; 35, expression_statement; 36, expression_statement; 37, for_statement; 38, return_statement; 39, identifier:repo_name; 40, None; 41, identifier:profile; 42, string; 43, identifier:milestone; 44, None; 45, identifier:state; 46, string; 47, identifier:assignee; 48, None; 49, identifier:creator; 50, None; 51, identifier:mentioned; 52, None; 53, identifier:labels; 54, None; 55, identifier:sort; 56, string; 57, identifier:direction; 58, string; 59, identifier:since; 60, None; 61, identifier:output; 62, string; 63, identifier:per_page; 64, None; 65, string; 66, assignment; 67, comparison_operator:repo_name is None; 68, block; 69, assignment; 70, assignment; 71, identifier:milestone; 72, block; 73, identifier:assignee; 74, block; 75, identifier:creator; 76, block; 77, identifier:mentioned; 78, block; 79, identifier:labels; 80, block; 81, identifier:since; 82, block; 83, identifier:per_page; 84, block; 85, boolean_operator; 86, block; 87, boolean_operator; 88, block; 89, boolean_operator; 90, block; 91, assignment; 92, assignment; 93, identifier:issue; 94, identifier:issues; 95, comment:# Pull requests are included in the issue list from GitHub; 96, comment:# Let's not include those in the return.; 97, block; 98, identifier:ret; 99, string_content:github; 100, string_content:open; 101, string_content:created; 102, string_content:desc; 103, string_content:min; 104, string_content:Returns information for all issues in a given repository, based on the search options.
  
      .. 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``.
  
      milestone
          The number of a GitHub milestone, or a string of either ``*`` or
          ``none``.
  
          If a number is passed, it should refer to a milestone by its number
          field. Use the ``github.get_milestone`` function to obtain a milestone's
          number.
  
          If the string ``*`` is passed, issues with any milestone are
          accepted. If the string ``none`` is passed, issues without milestones
          are returned.
  
      state
          Indicates the state of the issues to return. Can be either ``open``,
          ``closed``, or ``all``. Default is ``open``.
  
      assignee
          Can be the name of a user. Pass in ``none`` (as a string) for issues
          with no assigned user or ``*`` for issues assigned to any user.
  
      creator
          The user that created the issue.
  
      mentioned
          A user that's mentioned in the issue.
  
      labels
          A string of comma separated label names. For example, ``bug,ui,@high``.
  
      sort
          What to sort results by. Can be either ``created``, ``updated``, or
          ``comments``. Default is ``created``.
  
      direction
          The direction of the sort. Can be either ``asc`` or ``desc``. Default
          is ``desc``.
  
      since
          Only issues updated at or after this time are returned. This is a
          timestamp in ISO 8601 format: ``YYYY-MM-DDTHH:MM:SSZ``.
  
      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. Maximum is 100.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion github.get_issues my-github-repo; 105, identifier:org_name; 106, call; 107, identifier:repo_name; 108, None; 109, expression_statement; 110, identifier:action; 111, call; 112, identifier:args; 113, dictionary; 114, expression_statement; 115, expression_statement; 116, expression_statement; 117, expression_statement; 118, expression_statement; 119, expression_statement; 120, expression_statement; 121, identifier:state; 122, comparison_operator:state != 'open'; 123, expression_statement; 124, identifier:sort; 125, comparison_operator:sort != 'created'; 126, expression_statement; 127, identifier:direction; 128, comparison_operator:direction != 'desc'; 129, expression_statement; 130, identifier:ret; 131, dictionary; 132, identifier:issues; 133, call; 134, if_statement; 135, expression_statement; 136, if_statement; 137, identifier:_get_config_value; 138, argument_list; 139, assignment; 140, attribute; 141, argument_list; 142, assignment; 143, assignment; 144, assignment; 145, assignment; 146, assignment; 147, assignment; 148, assignment; 149, identifier:state; 150, string; 151, assignment; 152, identifier:sort; 153, string; 154, assignment; 155, identifier:direction; 156, string; 157, assignment; 158, identifier:_query; 159, argument_list; 160, call; 161, block; 162, assignment; 163, comparison_operator:output == 'full'; 164, block; 165, else_clause; 166, identifier:profile; 167, string; 168, identifier:repo_name; 169, call; 170, string; 171, identifier:join; 172, list; 173, subscript; 174, identifier:milestone; 175, subscript; 176, identifier:assignee; 177, subscript; 178, identifier:creator; 179, subscript; 180, identifier:mentioned; 181, subscript; 182, identifier:labels; 183, subscript; 184, identifier:since; 185, subscript; 186, identifier:per_page; 187, string_content:open; 188, subscript; 189, identifier:state; 190, string_content:created; 191, subscript; 192, identifier:sort; 193, string_content:desc; 194, subscript; 195, identifier:direction; 196, identifier:profile; 197, keyword_argument; 198, keyword_argument; 199, keyword_argument; 200, attribute; 201, argument_list; 202, continue_statement; 203, identifier:issue_id; 204, call; 205, identifier:output; 206, string; 207, expression_statement; 208, block; 209, string_content:org_name; 210, identifier:_get_config_value; 211, argument_list; 212, string_content:/; 213, string; 214, identifier:org_name; 215, identifier:repo_name; 216, identifier:args; 217, string; 218, identifier:args; 219, string; 220, identifier:args; 221, string; 222, identifier:args; 223, string; 224, identifier:args; 225, string; 226, identifier:args; 227, string; 228, identifier:args; 229, string; 230, identifier:args; 231, string; 232, identifier:args; 233, string; 234, identifier:args; 235, string; 236, identifier:action; 237, identifier:action; 238, identifier:command; 239, string; 240, identifier:args; 241, identifier:args; 242, identifier:issue; 243, identifier:get; 244, string; 245, attribute; 246, argument_list; 247, string_content:full; 248, assignment; 249, expression_statement; 250, identifier:profile; 251, string; 252, string_content:repos; 253, string_content:milestone; 254, string_content:assignee; 255, string_content:creator; 256, string_content:mentioned; 257, string_content:labels; 258, string_content:since; 259, string_content:per_page; 260, string_content:state; 261, string_content:sort; 262, string_content:direction; 263, string_content:issues; 264, string_content:pull_request; 265, identifier:issue; 266, identifier:get; 267, string; 268, subscript; 269, identifier:issue; 270, assignment; 271, string_content:repo_name; 272, string_content:id; 273, identifier:ret; 274, identifier:issue_id; 275, subscript; 276, call; 277, identifier:ret; 278, identifier:issue_id; 279, identifier:_format_issue; 280, argument_list; 281, identifier:issue
code: def get_issues(repo_name=None,
                 profile='github',
                 milestone=None,
                 state='open',
                 assignee=None,
                 creator=None,
                 mentioned=None,
                 labels=None,
                 sort='created',
                 direction='desc',
                 since=None,
                 output='min',
                 per_page=None):
      '''
      Returns information for all issues in a given repository, based on the search options.
  
      .. 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``.
  
      milestone
          The number of a GitHub milestone, or a string of either ``*`` or
          ``none``.
  
          If a number is passed, it should refer to a milestone by its number
          field. Use the ``github.get_milestone`` function to obtain a milestone's
          number.
  
          If the string ``*`` is passed, issues with any milestone are
          accepted. If the string ``none`` is passed, issues without milestones
          are returned.
  
      state
          Indicates the state of the issues to return. Can be either ``open``,
          ``closed``, or ``all``. Default is ``open``.
  
      assignee
          Can be the name of a user. Pass in ``none`` (as a string) for issues
          with no assigned user or ``*`` for issues assigned to any user.
  
      creator
          The user that created the issue.
  
      mentioned
          A user that's mentioned in the issue.
  
      labels
          A string of comma separated label names. For example, ``bug,ui,@high``.
  
      sort
          What to sort results by. Can be either ``created``, ``updated``, or
          ``comments``. Default is ``created``.
  
      direction
          The direction of the sort. Can be either ``asc`` or ``desc``. Default
          is ``desc``.
  
      since
          Only issues updated at or after this time are returned. This is a
          timestamp in ISO 8601 format: ``YYYY-MM-DDTHH:MM:SSZ``.
  
      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. Maximum is 100.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion github.get_issues my-github-repo
      '''
      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 = {}
  
      # Build API arguments, as necessary.
      if milestone:
          args['milestone'] = milestone
      if assignee:
          args['assignee'] = assignee
      if creator:
          args['creator'] = creator
      if mentioned:
          args['mentioned'] = mentioned
      if labels:
          args['labels'] = labels
      if since:
          args['since'] = since
      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 != 'created':
          args['sort'] = sort
      if direction and direction != 'desc':
          args['direction'] = direction
  
      ret = {}
      issues = _query(profile, action=action, command='issues', args=args)
  
      for issue in issues:
          # Pull requests are included in the issue list from GitHub
          # Let's not include those in the return.
          if issue.get('pull_request'):
              continue
          issue_id = issue.get('id')
          if output == 'full':
              ret[issue_id] = issue
          else:
              ret[issue_id] = _format_issue(issue)
  
      return ret