<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def WriteToPath(obj, filepath):
 """Serializes and writes given Python object to the specified YAML file. Args: obj: A Python object to serialize. filepath: A path to the file into which the object is to be written. """

  with io.open(filepath, mode="w", encoding="utf-8") as filedesc:
    WriteToFile(obj, filedesc)