Save parameters to file.

        Parameters
        ----------
        filename : str
            Path to parameter file.
        strip_prefix : str, default ''
            Strip prefix from parameter names before saving.
502797
def save(self, filename, strip_prefix=''):
        
        arg_dict = {}
        for param in self.values():
            weight = param._reduce()
            if not param.name.startswith(strip_prefix):
                raise ValueError(
                    "Prefix '%s' is to be striped before saving, but Parameter's "
                    "name '%s' does not start with '%s'. "
                    "this may be due to your Block shares parameters from other "
                    "Blocks or you forgot to use 'with name_scope()' when creating "
                    "child blocks. For more info on naming, please see "
                    "http://mxnet.incubator.apache.org/tutorials/basic/naming.html"%(
                        strip_prefix, param.name, strip_prefix))
            arg_dict[param.name[len(strip_prefix):]] = weight
        ndarray.save(filename, arg_dict)
163081
def _write_parameter_file(params):
    
    
    # Get path
    path = os.path.join(get_tempdir(), 'params.txt')
    
    # Define helper function
    def valToStr(val):
        if val in [True, False]:
            return '"%s"' % str(val).lower()
        elif isinstance(val, int):
            return str(val)
        elif isinstance(val, float):
            tmp = str(val)
            if not '.' in tmp:
                tmp += '.0'
            return tmp
        elif isinstance(val, str):
            return '"%s"' % val
    
    # Compile text
    text = ''
    for key in params:
        val = params[key]
        # Make a string of the values
        if isinstance(val, (list, tuple)):
            vals = [valToStr(v) for v in val]
            val_ = ' '.join(vals)
        else:
            val_ = valToStr(val)
        # Create line and add
        line = '(%s %s)' % (key, val_)
        text += line + '\n'
    
    # Write text
    f = open(path, 'wb')
    try:
        f.write(text.encode('utf-8'))
    finally:
        f.close()
    
    # Done
    return path
191748
def save(filename, path, params={})
      payload = get! path, nil, params
      File.write filename, payload.response.body
    end
774652
def save(self, fname: str):
        
        with open(fname, "wb") as fp:
            pickle.dump(self, fp)
807122
def save_file(self, filename, encoding='utf8', headers=None,
                  convertors=None, display=True, **kwargs):
        
        global save_file
        
        convertors = convertors or {}
        headers = headers or []
        
        fields = self.get_fields()
        _header = []
        for i, column in enumerate(fields):
            if column.name not in convertors:
                if display:
                    def f(value, data):
                        return column.get_display_value(value)

                    convertors[column.name] = f
            flag = False
            for j in headers:
                if not isinstance(j, dict):
                    raise ValueError("Header should be a list of dict, but {} type found".format(type(j)))
                if j['name'] == column.name:
                    _header.append(j)
                    flag = True
                    break
            if not flag:
                d = {'name':column.name}
                if display:
                    d['title'] = column.verbose_name or column.name
                else:
                    d['title'] = column.name
                _header.append(d)

        return save_file(self.run(), filename, encoding=encoding,
                         headers=_header, convertors=convertors, **kwargs)
988075
def save(self, name):
        
        self.finalize()
        with open(name, 'wb+') as f:
            if six.PY3:
                f.write(self.fileobj.getbuffer())
            else:
                f.write(self.fileobj.getvalue().encode('utf-8'))
1231911
def load_parameters(self, filename, ctx=mx.cpu()): # pylint: disable=arguments-differ
        
        self.lm_model.load_parameters(filename, ctx=ctx)
1112227
def to_file_url(filename):
    
    url = 'file://' + os.path.abspath(filename).replace(os.path.sep, '/')
    return url
867417
def htmlSaveFile(self, filename):
        
        ret = libxml2mod.htmlSaveFile(filename, self._o)
        return ret
249
def save(self, filename):
        

        with open(filename, 'wb') as savefile:
            pickle.dump(self.__dict__,
                        savefile,
                        protocol=pickle.HIGHEST_PROTOCOL)
701642
def get_filename(self, prefix, url):
        
        return '{}.txt'.format(os.path.join(os.getcwd(), prefix, self.clean_url(url)))
734606
def save(self, filename, encoding ='ISO-8859-1', standalone='no'):
        
        f = codecs.open(filename, 'w', encoding)
        s = self.wrap_xml(self.getXML(), encoding, standalone)
        #s = s.replace("&", "&amp;")
        f.write(s)
        f.close()
640808
def save(self, wfs, filename=None):
        ''''''
        if self.basename and not filename:
            ext = extension(filename or wfs.filename)
            filename = '.'.join([self.basename(self._instance), ext])
        prefix = self.upload_to(self._instance) if callable(self.upload_to) else self.upload_to
        self.filename = self.fs.save(wfs, filename, prefix=prefix)
        return self.filename
917917
def zSaveFile(self, fileName):
        
        cmd = "SaveFile,{}".format(fileName)
        reply = self._sendDDEcommand(cmd)
        return int(float(reply.rstrip()))
697672
def to_file(self, filename):
        
        filename = os.path.expanduser(filename)
        libfn = utils.get_lib_fn('toFile%s'%self._libsuffix)
        libfn(self.pointer, filename)
1349701
def save(self, filename):
        ''''''
        f = open(filename, mode='w')
        f.write("QGC WPL 110\n")
        for w in self.wpoints:
            if getattr(w, 'comment', None):
                f.write("# %s\n" % w.comment)
            f.write("%u\t%u\t%u\t%u\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%u\n" % (
                w.seq, w.current, w.frame, w.command,
                w.param1, w.param2, w.param3, w.param4,
                w.x, w.y, w.z, w.autocontinue))
        f.close()
1245549
def save(self, filename=None):
        
        if not filename:
            filename = self.filename
        if not filename:
            raise Exception("No filename specified")
        if filename[-4:].lower() == '.bz2':
            f = bz2.BZ2File(filename,'wb')
            f.write(self.xmlstring().encode('utf-8'))
            f.close()
        elif filename[-3:].lower() == '.gz':
            f = gzip.GzipFile(filename,'wb') #pylint: disable=redefined-variable-type
            f.write(self.xmlstring().encode('utf-8'))
            f.close()
        else:
            f = io.open(filename,'w',encoding='utf-8')
            f.write(self.xmlstring())
            f.close()