def ParseMany ( text ) : precondition . AssertType ( text , Text ) if compatibility . PY2 : text = text . encode ( "utf-8" ) return list ( yaml . safe_load_all ( text ) )
python yaml load multiple documents
Parses many YAML documents into a list of Python objects .
def ParseMany(text):
  """Parses many YAML documents into a list of Python objects.

  Args:
    text: A YAML source with multiple documents embedded.

  Returns:
    A list of Python data structures corresponding to the YAML documents.
  """
  precondition.AssertType(text, Text)

  if compatibility.PY2:
    text = text.encode("utf-8")

  return list(yaml.safe_load_all(text))