def Parse ( text ) : precondition . AssertType ( text , Text ) if compatibility . PY2 : text = text . encode ( "utf-8" ) return yaml . safe_load ( text )
yaml array values parsing in python
Parses a YAML source into a Python object .
def Parse(text):
  """Parses a YAML source into a Python object.

  Args:
    text: A YAML source to parse.

  Returns:
    A Python data structure corresponding to the YAML source.
  """
  precondition.AssertType(text, Text)

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

  return yaml.safe_load(text)