This function saves the system name, if different from stored.
968035
def remote_sys_name_uneq_store(self, remote_system_name):
        
        if remote_system_name != self.remote_system_name:
            self.remote_system_name = remote_system_name
            return True
        return False
1317128
def save_config(name, data, base='conf'):
    """"""
    if not os.path.exists(base):
        os.mkdir(base)
    fname = pjoin(base, name+'.json')
    with open(fname, 'w') as f:
        json.dump(data, f, indent=2)
977219
def save(self, name):
        
        with open(name, 'wb+') as f:
            while True:
                buf = self._fileobj.read()
                if not buf:
                    break
                f.write(buf)
752784
def store_value(self, name, value):
        """"""
        self.spine.send_command("storeSetting", self.group, name, value)
707459
function save(storage, name, value) {
        var key = '$BD$' + name;
        if (value === null) value = '';
        storage[key] = value;
      }
90359
def save_config(self, cmd="write mem", confirm=False, confirm_response=""):
        """"""
        return super(OneaccessOneOSBase, self).save_config(
            cmd=cmd, confirm=confirm, confirm_response=confirm_response
        )
658216
def hostname(name):
    '''
    
    '''
    ret = {
        'name': name,
        'changes': {},
        'result': True,
        'comment': ''
    }

    current_hostname = __salt__['system.get_hostname']()

    if current_hostname.upper() == name.upper():
        ret['comment'] = "Hostname is already set to '{0}'".format(name)
        return ret

    out = __salt__['system.set_hostname'](name)

    if out:
        ret['comment'] = "The current hostname is '{0}', " \
                         "but will be changed to '{1}' on the next reboot".format(current_hostname, name)
        ret['changes'] = {'hostname': name}
    else:
        ret['result'] = False
        ret['comment'] = 'Unable to set hostname'

    return ret
1150684
def name_to_system_object(self, name):
        
        if isinstance(name, str):
            if self.allow_name_referencing:
                name = name
            else:
                raise NameError('System.allow_name_referencing is set to False, cannot convert string to name')
        elif isinstance(name, Object):
            name = str(name)
        return self.namespace.get(name, None)
1234165
def saveInputs(self, fname):
        
        # save current inputs to file for loading next time
        if not fname:
            return
            
        appdir = systools.get_appdir()
        if not os.path.isdir(appdir):
            os.makedirs(appdir)
        fname = os.path.join(appdir, fname)

        savedict = {}
        savedict['binsz'] = self.ui.binszSpnbx.value()
        savedict['aifs'] = self.ui.aifsSpnbx.value()
        savedict['tscale'] = self.tscale
        savedict['fscale'] = self.fscale
        savedict['saveformat'] = self.saveformat
        savedict['ex_nreps'] = self.ui.exploreStimEditor.repCount()
        savedict['reprate'] = self.ui.reprateSpnbx.value()
        savedict['windowsz'] = self.ui.windowszSpnbx.value()
        savedict['specargs'] = self.specArgs
        savedict['viewSettings'] = self.viewSettings
        savedict['calvals'] = self.calvals
        savedict['calparams'] = self.acqmodel.calibration_template()
        savedict['calreps'] = self.ui.calibrationWidget.ui.nrepsSpnbx.value()
        savedict['mphonesens'] = self.ui.mphoneSensSpnbx.value()
        savedict['mphonedb'] = self.ui.mphoneDBSpnbx.value()
        savedict['vocalpaths'] = Vocalization.paths
        savedict['aichans'] = self._aichans
        savedict['aichan_details'] = self._aichan_details

        # parameter settings -- save all tracks present
        savedict['explorestims'] = self.ui.exploreStimEditor.saveTemplate()

        savedict['advanced_options'] = self.advanced_options
        savedict['stim_view_defaults'] = StimulusView.getDefaults()

        savedict['tuning_curve'] = TCFactory.defaultInputs

        # filter out and non-native python types that are not json serializable
        savedict = convert2native(savedict)
        try:
            with open(fname, 'w') as jf:
                json.dump(savedict, jf)
        except:
            logger = logging.getLogger('main')
            logger.exception("Unable to save app data to file: {}".format(fname))
144031
def save(self, filename=None, verbose=False):
        ''' 
        '''
        if filename is None:
            if (not self.has_section(self.application_name) or
                    not self.has_option(self.application_name, 'config_file')):
                if not self.has_section(self.application_name):
                    self.add_section(self.application_name)
                if not self.application_name in self.config_description:
                    self.config_description[self.application_name] = {}

                appdir = AppDirs(self.application_name,
                        self.application_author,
                        version=self.application_version)
                value = os.path.join(appdir.user_data_dir, '{0}.conf'.format(
                    self.application_name.lower()))
                if not self.has_option(self.application_name, 'config_file'):
                    self.set(self.application_name, 'config_file', value)
                if not ('config_file' in
                        self.config_description[self.application_name]):
                    self.config_description[self.application_name]\
                            ['config_file'] = ('The config file to '
                                'overwrite on change of the config values. '
                                '[$HOME/.{0}/{0}.conf]'.format(
                                    self.application_name), str, value)

            filename = self.get(self.application_name, 'config_file')

        if not os.path.exists(os.path.dirname(filename)):
            os.makedirs(os.path.dirname(filename))

        hidden = None
        if self.has_section('hidden'):
            hidden = self.items('hidden')
            self.remove_section('hidden')

        cfp = open(filename, 'w')
        self._write_config(cfp, verbose)
        cfp.close()

        if hidden is not None:
            for key, value in hidden:
                self.set('hidden', key, value)
717048
private static String fixName(String name) {
    // convert old-format name to new-format name
    if (name.equals("local")) {         // "local" is now "file:///".
      LOG.warn("\"local\" is a deprecated filesystem name."
               +" Use \"file:///\" instead.");
      name = "file:///";
    } else if (name.indexOf('/')==-1) {   // unqualified is "hdfs://"
      LOG.warn("\""+name+"\" is a deprecated filesystem name."
               +" Use \"hdfs://"+name+"/\" instead.");
      name = "hdfs://"+name;
    }
    return name;
  }
3668
def save_as(self, name=None, close=False):
        """"""
        current_client = self.get_current_client()
        current_client.save()
        original_path = current_client.get_filename()
        if not name:
            original_name = osp.basename(original_path)
        else:
            original_name = name
        filename, _selfilter = getsavefilename(self, _("Save notebook"),
                                               original_name, FILES_FILTER)
        if filename:
            nb_contents = nbformat.read(original_path, as_version=4)
            nbformat.write(nb_contents, filename)
            if not close:
                self.close_client(save=True)
            self.create_new_client(filename=filename)
693567
def save_cert(name, master):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}
    cert = "{0}trusted-master.crt".format(get_certs_path())

    # Checking if execution is needed.
    if os.path.isfile(cert):
        ret['comment'] = 'No execution needed. Cert: {0} already saved.'.format(cert)
        return ret
    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Certificate save for icinga2 master would be executed'
        return ret

    # Executing the command.
    cert_save = __salt__['icinga2.save_cert'](name, master)
    if not cert_save['retcode']:
        ret['comment'] = "Certificate for icinga2 master saved"
        ret['changes']['cert'] = "Executed. Certificate saved: {0}".format(cert)
    return ret
1309077
def save_data(self, idx):
        """"""
        for name in self:
            actual = getattr(self, name)
            diskflag = getattr(self, '_%s_diskflag' % name)
            ramflag = getattr(self, '_%s_ramflag' % name)
            if diskflag:
                file_ = getattr(self, '_%s_file' % name)
                ndim = getattr(self, '_%s_ndim' % name)
                length_tot = 1
                for jdx in range(ndim):
                    length = getattr(self, '_%s_length_%s' % (name, jdx))
                    length_tot *= length
                if ndim:
                    raw = struct.pack(length_tot*'d', *actual.flatten())
                else:
                    raw = struct.pack('d', actual)
                file_.write(raw)
            elif ramflag:
                array = getattr(self, '_%s_array' % name)
                array[idx] = actual
1232753
def _save(self, name, content):
        
        name = self.clean_name(name)  # to change to UNIX style path on windows if necessary
        if not self._exists_with_etag(name, content):
            content.seek(0)
            super(StaticCloudinaryStorage, self)._save(name, content)
        return self._prepend_prefix(name)
1164489
def _save(self):
        

        if self.__modified_flag:
            self.__filename_rep.update_id_counter()
            indexfilename = os.path.join(self.__dir, "index.dat")
            self._write_file(
                indexfilename,
                (self.__index,
                 self.__filename_rep))

            self.__modified_flag = False
1296382
def save(self, filename):
		'''  '''

		import json
		f = open(filename, 'w')
		json.dump(self.settings, f, indent = 4)
		f.close()