<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def structure_transform(self, original_structure, new_structure, refine_rotation=True):
 """ Transforms a tensor from one basis for an original structure into a new basis defined by a new structure. Args: original_structure (Structure):
 structure corresponding to the basis of the current tensor new_structure (Structure):
 structure corresponding to the desired basis refine_rotation (bool):
 whether to refine the rotations generated in get_ieee_rotation Returns: Tensor that has been transformed such that its basis corresponds to the new_structure's basis """

        sm = StructureMatcher()
        if not sm.fit(original_structure, new_structure):
            warnings.warn("original and new structures do not match!")
        trans_1 = self.get_ieee_rotation(original_structure, refine_rotation)
        trans_2 = self.get_ieee_rotation(new_structure, refine_rotation)
        # Get the ieee format tensor
        new = self.rotate(trans_1)
        # Reverse the ieee format rotation for the second structure
        new = new.rotate(np.transpose(trans_2))
        return new