code: def assign_milestone(self, number, version):
      url = f"{self.github_api}/issues/{number}"
      milestone_number = self.get_milestone_number(version)
      if not milestone_number:
          raise ValueError(
              f"Invalid version {version}, milestone not found"
          )
      payload = {"milestone": milestone_number}
      r = requests.patch(url, headers=self.headers, json=payload)
      if not r.ok:
          raise ValueError(
              f"Failed request: {url}:{r.status_code} -> {r.json()}"
          )
      return r.json()
  
imports: import configparser
  import os
  import pprint
  import re
  import subprocess
  import sys
  import requests
  import getpass
  from six.moves import input
  import six
label_desc: Use image node_id 9 for calling the GitHubAPI obj's underlying member method code with example usage: obj.assign_milestone(number, version) and returns: r