def _normalize_value(val, null):
    """Returns a normalized attribute value. A value can be either a string, or None. If None, the
  value of :null: will be returned instead.

  :val: a string or None
  :null: a string to be returned when :val: is None
  """
    if val is None:
        return null
    else:
        return str(val)
