code: def genderize(name, api_token=None):
      
  
      GENDERIZE_API_URL = "https://api.genderize.io/"
      TOTAL_RETRIES = 10
      MAX_RETRIES = 5
      SLEEP_TIME = 0.25
      STATUS_FORCELIST = [502]
  
      params = {
          'name': name
      }
  
      if api_token:
          params['apikey'] = api_token
  
      session = requests.Session()
  
      retries = urllib3.util.Retry(total=TOTAL_RETRIES,
                                   connect=MAX_RETRIES,
                                   status=MAX_RETRIES,
                                   status_forcelist=STATUS_FORCELIST,
                                   backoff_factor=SLEEP_TIME,
                                   raise_on_status=True)
  
      session.mount('http://', requests.adapters.HTTPAdapter(max_retries=retries))
      session.mount('https://', requests.adapters.HTTPAdapter(max_retries=retries))
  
      r = session.get(GENDERIZE_API_URL, params=params)
      r.raise_for_status()
      result = r.json()
  
      gender = result['gender']
      prob = result.get('probability', None)
  
      acc = int(prob * 100) if prob else None
  
      return gender, acc
docs: Fetch gender from genderize.io