<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_samp):
 """ Set self.sample as either an empty string, or with a new Sample. """

        self.sample = new_samp
        if new_samp:
            if not isinstance(new_samp, Sample):
                raise Exception
        self.propagate_data()
        return new_samp