def _AssertDataIsList(key, lst):
  """Assert that lst contains list data and is not structured."""

  # list and tuple are supported.  Not supported are direct strings
  # and dictionary; these indicate too much or two little structure.
  if not isinstance(lst, list) and not isinstance(lst, tuple):
    raise NotAListError('%s must be a list' % key)

  # each list entry must be a string
  for element in lst:
    if not isinstance(element, str):
      raise ElementNotAStringError('Unsupported list element %s found in %s',
                                   (element, lst))
Assert that lst contains list data and is not structured.