code: def user_loc_string_to_value(axis_tag, user_loc):
      
      if axis_tag == "wght":
          try:
              value = _nospace_lookup(WEIGHT_CODES, user_loc)
          except KeyError:
              return None
          return class_to_value("wght", value)
      elif axis_tag == "wdth":
          try:
              value = _nospace_lookup(WIDTH_CODES, user_loc)
          except KeyError:
              return None
          return class_to_value("wdth", value)
  
      # Currently this function should only be called with a width or weight
      raise NotImplementedError
docs: Go from Glyphs UI strings to user space location.
      Returns None if the string is invalid.
  
      >>> user_loc_string_to_value('wght', 'ExtraLight')
      200
      >>> user_loc_string_to_value('wdth', 'SemiCondensed')
      87.5
      >>> user_loc_string_to_value('wdth', 'Clearly Not From Glyphs UI')