code: def expected_os2_weight(style):
    
    if not style:
      return None
    # Weight name to value mapping:
    GF_API_WEIGHTS = {
        "Thin": 250,
        "ExtraLight": 275,
        "Light": 300,
        "Regular": 400,
        "Medium": 500,
        "SemiBold": 600,
        "Bold": 700,
        "ExtraBold": 800,
        "Black": 900
    }
    if style == "Italic":
      weight_name = "Regular"
    elif style.endswith("Italic"):
      weight_name = style.replace("Italic", "")
    else:
      weight_name = style
  
    expected = GF_API_WEIGHTS[weight_name]
    return weight_name, expected
docs: The weight name and the expected OS/2 usWeightClass value inferred from
    the style part of the font name
  
    The Google Font's API which serves the fonts can only serve
    the following weights values with the corresponding subfamily styles:
  
    250, Thin
    275, ExtraLight
    300, Light
    400, Regular
    500, Medium
    600, SemiBold
    700, Bold
    800, ExtraBold
    900, Black
  
    Thin is not set to 100 because of legacy Windows GDI issues:
    https://www.adobe.com/devnet/opentype/afdko/topic_font_wt_win.html