<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def video_to_file(self, path):
 """Write video to file. :param path: Path to write file """

        _LOGGER.debug("Writing video from %s to %s", self.name, path)
        response = self._cached_video
        if response is None:
            _LOGGER.error("No saved video exist for %s.",
                          self.name,
                          exc_info=True)
            return
        with open(path, 'wb') as vidfile:
            copyfileobj(response.raw, vidfile)