Parameters
        ----------
        config : str
        info : str
        save_dir : str
331803
def mutation(self, config=None, info=None, save_dir=None):
        
        self.result = None
        self.config = config
        self.restore_dir = self.save_dir
        self.save_dir = save_dir
        self.info = info
68918
def save(cls, filename, config):
        
        mode = os.O_WRONLY | os.O_TRUNC | os.O_CREAT
        with os.fdopen(os.open(filename, mode, 0o600), 'w') as fname:
            yaml.safe_dump(config, fname, indent=4, default_flow_style=False)
560571
def save(self, filename=None):
        
        content = self.data.yaml()
        with open(Config.path_expand(ConfigDict.filename), 'w') as f:
            f.write(content)
386889
def write_config(data, conf_dir=DEFAULT_CONFIG_DIR, codec="yaml",
                 backup_existing=False):
    
    if not codec:
        codec = 'yaml'
    codec = munge.get_codec(codec)()
    conf_dir = os.path.expanduser(conf_dir)
    if not os.path.exists(conf_dir):
        os.mkdir(conf_dir)

    # Check for existing file, back up if necessary
    outpath = os.path.join(conf_dir, 'config.' + codec.extensions[0])
    if backup_existing and os.path.exists(outpath):
        os.rename(outpath, outpath + '.bak')
    codec.dump(data, open(outpath, 'w'))
288632
def save_config(self, data: dict) -> Path:
        """"""
        out_dir = Path(self.families_dir) / data['family']
        out_dir.mkdir(parents=True, exist_ok=True)
        out_path = out_dir / 'pedigree.yaml'
        dump = ruamel.yaml.round_trip_dump(data, indent=4, block_seq_indent=2)
        out_path.write_text(dump)
        return out_path
922489
def config_dir_setup(filename):
    
    path = os.path.dirname(filename)
    if not os.path.isdir(path):
        Shell.mkdir(path)
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
        )
1371298
def write_config(config, config_path=CONFIG_PATH):
    
    if not os.path.exists(config_path):
        os.makedirs(os.path.dirname(config_path))
    with open(config_path, 'w', encoding='utf-8') as f:
        config.write(f)
672952
def write_config(self):
        
        if not os.path.exists(os.path.dirname(self.config_file)):
            os.makedirs(os.path.dirname(self.config_file))
        with open(self.config_file, 'w') as f:
            f.write(json.dumps(self.config))
            f.close()
794923
def update_file(finfo, sample_info, config, pass_uptodate=False):
    
    storage_dir = utils.safe_makedir(_get_storage_dir(finfo, config))
    if finfo.get("type") == "directory":
        return _copy_finfo_directory(finfo, storage_dir)
    else:
        return _copy_finfo(finfo, storage_dir, pass_uptodate=pass_uptodate)
1033704
def __prepare_info_from_dicomdir_file(self, writedicomdirfile=True):
        
        createdcmdir = True

        dicomdirfile = os.path.join(self.dirpath, self.dicomdir_filename)
        ftype = 'pickle'
        # if exist dicomdir file and is in correct version, use it
        if os.path.exists(dicomdirfile):
            try:
                dcmdirplus = misc.obj_from_file(dicomdirfile, ftype)
                if dcmdirplus['version'] == __version__:
                    createdcmdir = False
                dcmdir = dcmdirplus['filesinfo']
            except Exception:
                logger.debug('Found dicomdir.pkl with wrong version')
                createdcmdir = True

        if createdcmdir or self.force_create_dicomdir:
            dcmdirplus = self._create_dicomdir_info()
            dcmdir = dcmdirplus['filesinfo']
            if (writedicomdirfile) and len(dcmdir) > 0:
                # obj_to_file(dcmdirplus, dicomdirfile, ftype)
                try:
                    misc.obj_to_file(dcmdirplus, dicomdirfile, ftype)
                except:
                    logger.warning('Cannot write dcmdir file')
                    traceback.print_exc()

                # bj_to_file(dcmdir, dcmdiryamlpath )

        dcmdir = dcmdirplus['filesinfo']
        self.dcmdirplus = dcmdirplus
        self.files_with_info = dcmdir
        return dcmdir
590996
def dump_config(self):
        
        path = os.path.join(tempfile.gettempdir(),
                            'dump-cfg-scheduler-%s-%d.json' % (self.name, int(time.time())))

        try:
            self.pushed_conf.dump(path)
        except (OSError, IndexError) as exp:  # pragma: no cover, should never happen...
            logger.critical("Error when writing the configuration dump file %s: %s",
                            path, str(exp))
808595
def store_config(config, suffix = None):
    '''
    
    '''
    home = os.path.expanduser('~')
    if suffix is not None:
        config_path = os.path.join(home, '.transfer', suffix)
    else:
        config_path = os.path.join(home, '.transfer')

    os.makedirs(config_path, exist_ok = True)
    with open(os.path.join(config_path, 'config.yaml'), 'w') as fp:
        yaml.dump(config, fp)
777592
def _save_or_update(self):
        
        with self._resource_lock:
            if not self._config or not self._config._storage_path:
                raise Exception("self._config._storage path is undefined")
            if not self._config._base_name:
                raise Exception("self._config._base_name is undefined")
            if not os.path.exists(self._config._storage_path):
                os.makedirs(self._config._storage_path)
            path = self._get_cloud_provider_storage_path()
            with open(path, 'wb') as storage:
                pickle.dump(self._config, storage, pickle.HIGHEST_PROTOCOL)
                pickle.dump(self._subscriptions, storage,
                            pickle.HIGHEST_PROTOCOL)
1146554
def store(auth, provider, config_location=DEFAULT_CONFIG_DIR):
    

    auth_file = None
    try:
        # only for custom locations
        _create_config_dir(config_location,
                           "Creating custom config directory [%s]... ")

        config_dir = os.path.join(config_location, NOIPY_CONFIG)
        _create_config_dir(config_dir, "Creating directory [%s]... ")

        auth_file = os.path.join(config_dir, provider)
        print("Creating auth info file [%s]... " % auth_file, end="")
        with open(auth_file, 'w') as f:
            buff = auth.base64key.decode('utf-8')
            f.write(buff)
        print("OK.")

    except IOError as e:
        print('{0}: "{1}"'.format(e.strerror, auth_file))
        raise e
682268
def save(self, filename=None):
        """"""
        if self.__fname is None and filename is None:
            raise ValueError('Config loaded from string, no filename specified')
        conf = self.__config
        cpa = dict_to_cp(conf)
        with open(self.__fname if filename is None else filename, 'w') as f:
            cpa.write(f)
424359
def save_config(self):
        
        if not os.path.exists(self._conf_dir):
            os.makedirs(self._conf_dir)
        conf_file = os.path.join(self._conf_dir, "dql.json")
        with open(conf_file, "w") as ofile:
            json.dump(self.conf, ofile, indent=2)