code: def get_milestone_number(title, token, allow_closed):
      """Iterates over all open milestones looking for one with the given title."""
      open_str = "" if allow_closed else "states: OPEN,"
  
      def helper(cursor=None):
          cursor_or_null = f'"{cursor}"' if cursor else "null"
          query = f"""
          {{
              repository(owner: "bokeh", name: "bokeh") {{
                  milestones(first: 10, {open_str} after: {cursor_or_null}) {{
                      edges {{
                          node {{
                              number
                              title
                          }}
                      }}
                      pageInfo {{
                          endCursor
                      }}
                  }}
              }}
          }}
          """
          data = query_github(query, token)
          if not data:
              print("error: graphql query failure", file=sys.stderr)
              sys.exit(1)
          milestones = data["repository"]["milestones"]
          end_cursor = milestones["pageInfo"]["endCursor"]
          for edge in milestones["edges"]:
              if edge["node"]["title"] == title:
                  return edge["node"]["number"]
          return helper(end_cursor) if end_cursor else None
  
      return helper()
  
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 7 for calling a global function with example usage: get_milestone_number(title, token, allow_closed) and returns: helper, unknown, edge