<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def change_WD(self, new_WD, meas_file=""):
 """ Changes Demag GUI's current WD to new_WD if possible Parameters new_WD : WD to change to current GUI's WD """

        new_WD = os.path.abspath(new_WD)
        if not os.path.isdir(new_WD):
            return
        self.WD = new_WD
        if not meas_file:
            if self.data_model == None:
                if os.path.isfile(os.path.join(self.WD, "measurements.txt")) and os.path.isfile(os.path.join(self.WD, "magic_measurements.txt")):
                    ui_dialog = demag_dialogs.user_input(self, ['data_model'], parse_funcs=[
                                                         float], heading="More than one measurement file found in CWD with different data models please input prefered data model (2.5,3.0)", values=[3])
                    self.show_dlg(ui_dialog)
                    ui_data = ui_dialog.get_values()
                    self.data_model = ui_data[1]['data_model']
                elif os.path.isfile(os.path.join(self.WD, "measurements.txt")):
                    self.data_model = 3.0
                elif os.path.isfile(os.path.join(self.WD, "magic_measurements.txt")):
                    self.data_model = 2.5
                else:
                    self.user_warning(
                        "No measurement file found in chosen directory")
                    self.data_model = 3
            try:
                self.data_model = float(self.data_model)
                if int(self.data_model) == 3:
                    meas_file = os.path.join(self.WD, "measurements.txt")
                elif int(self.data_model) == 2:
                    meas_file = os.path.join(self.WD, "magic_measurements.txt")
                else:
                    meas_file = ''
                    self.data_model = 3
            except (ValueError, TypeError) as e:
                self.user_warning(
                    "Provided data model is unrecognized or invalid, assuming you want data model 3")
                self.data_model = 3

        if os.path.isfile(meas_file):
            self.magic_file = meas_file
        else:
            self.magic_file = self.choose_meas_file()

        if not self.data_model:
            self.data_model = 3