<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_parent(self, new_site):
 """ Set self.site as either an empty string, or with a new Site. """

        if new_site:
            if not isinstance(new_site, Site):
                raise Exception
        self.site = new_site
        self.propagate_data()
        return new_site