code: def ensure_object_is_string(item, title):
      
      assert isinstance(title, str)
  
      if not isinstance(item, str):
          msg = "{} must be a string. {} passed instead."
          raise TypeError(msg.format(title, type(item)))
  
      return None
docs: Checks that the item is a string. If not, raises ValueError.