code: def get_milestone_items(title, token, allow_closed):
      """Returns the issues and PRs in the milestone with the given title,
      otherwise None if the milestone doesn't exist.
      """
      milestone_number = get_milestone_number(
          title, token, allow_closed
      )
      if not milestone_number:
          return None
  
      results = []
  
      def helper(kind, cursor=None):
          cursor_or_null = f'"{cursor}"' if cursor else "null"
          query = f"""
          {{
              repository(owner: "bokeh", name: "bokeh") {{
                  milestone(number: {milestone_number}) {{
                      {kind}(first: 100, after: {cursor_or_null}) {{
                          edges {{
                              node {{
                                  number
                                  title
                                  state
                                  labels(first: 20) {{
                                      edges {{
                                          node {{
                                              name
                                          }}
                                      }}
                                  }}
                              }}
                          }}
                          pageInfo {{
                              endCursor
                          }}
                      }}
                  }}
              }}
          }}
          """
          data = query_github(query, token)
          if not data:
              print("error: graphql query failure", file=sys.stderr)
              sys.exit(1)
          items = data["repository"]["milestone"][kind]
          end_cursor = items["pageInfo"]["endCursor"]
          for edge in items["edges"]:
              edge["kind"] = kind
              results.append(edge)
          if end_cursor:
              helper(kind, end_cursor)
  
      helper("issues")
      helper("pullRequests")
      return results
  
file_path: bokeh/scripts/milestone.py
imports: import datetime
  import logging
  import os
  import sys
  from itertools import groupby
  from pathlib import Path
  import click
  import requests
label_desc: Use image node_id 10 for calling a global function with example usage: get_milestone_items(title, token, allow_closed) and returns: results, None