def save(self):
        if self.settings_dir is None or self.auth['email'] is None:
            return

        try:
            self.logger.debug('Save investment settings to file')

            # Add current profile to the investing JSON file object
            profile = self.investing.copy()
            try:
                # Load existing JSON file
                to_save = self.read_investment_settings_file()
            except Exception as e:
                # Create new JSON
                to_save = { 'profiles': {} }

            # Add filter_id
            if 'filters' in profile and type(profile['filters']) is SavedFilter:
                profile['filter_id'] = profile['filters'].id
                profile['filters'] = None
            else:
                profile['filter_id'] = None

            # Add profile and version
            to_save['profiles'][self.auth['email']] = profile
            to_save['last_profile'] = self.auth['email']
            to_save['version'] = util.get_version()
            to_save['format'] = self.settings_file_version

            json_out = json.dumps(to_save)

            # Save
            self.logger.debug('Saving investment settings file: {0}'.format(json_out))
            investing_file = os.path.join(self.settings_dir, self.investing_file)
            f = open(investing_file, 'w')
            f.write(json_out)
            f.close()

            self.logger.debug('Saved')
        except Exception as e:
            self.logger.warning('Could not save the investment settings to file: {0}'.format(str(e)))
Import a module, raising an ImportError exception if the module
dataset/ETHPy150Open jgillick/LendingClubAutoInvestor/lcinvestor/settings/__init__.py/Settings.save--crossover with--dataset/ETHPy150Open ctxis/canape/CANAPE.Scripting/Lib/rexec.py/RExec.s_import