export model into another format eg html, d3 etc...
    <fromshell> : the local name is being passed from ontospy shell
548266
def action_visualize(args,
                     fromshell=False,
                     path=None,
                     title="",
                     viztype="",
                     theme="",
                     verbose=False):
    

    from ..ontodocs.builder import ask_visualization, select_visualization, VISUALIZATIONS_LIST, build_visualization

    if fromshell:
        ontouri = args
        islocal = True
    else:
        ontouri = args[0]
        islocal = False

    # select a visualization
    if viztype:
        viztype = select_visualization(viztype)
    else:
        viztype = ask_visualization()
        if viztype == "":
            return None
        # raise SystemExit, 1

    # 2017-01-23: bypass pickled stuff as it has wrong counts etc..
    # get ontospy graph
    printDebug("Loading graph...", dim=True)
    g = Ontospy(ontouri, verbose=verbose)

    # put in home folder by default: <ontouri>/<viztype>/files..
    if not path:
        from os.path import expanduser
        home = expanduser("~")
        onto_path = slugify(unicode(ontouri))
        viz_path = slugify(unicode(VISUALIZATIONS_LIST[viztype]['Title']))
        path = os.path.join(home, "ontospy-viz/" + onto_path + "/" + viz_path)
        if not os.path.exists(path):
            os.makedirs(path)

    # url  = build_viz(ontouri, g, viztype, path)
    printDebug("Building visualization...", dim=True)
    url = build_visualization(ontouri, g, viztype, path, title, theme)

    return url
9930
def export_for_schema(self):
        
        if self.options_map:
            return dict((str(key), str(value)) for key, value in self.options_map.items())
        return "{'class': '%s'}" % (self.name, )
1048033
def export_base_dts(cls, graph, obj, nsm):
        

        o = {
            "@id": str(obj.asNode()),
            "@type": nsm.qname(obj.type),
            nsm.qname(RDF_NAMESPACES.HYDRA.title): str(obj.get_label()),
            nsm.qname(RDF_NAMESPACES.HYDRA.totalItems): obj.size
        }

        for desc in graph.objects(obj.asNode(), RDF_NAMESPACES.HYDRA.description):
            o[nsm.qname(RDF_NAMESPACES.HYDRA.description)] = str(desc)

        return o
774769
function modelExport(m) {
  const result = _.mapValues(m.classes, _.head)
  result[m.__name] = m
  return result
}
1236663
def save_model(self, fname='model.js'):
        
        exp_colorscale_str = json.dumps(self._exp_colorscale)
        mut_colorscale_str = json.dumps(self._mut_colorscale)
        cyjs_dict = {'edges': self._edges, 'nodes': self._nodes}
        model_str = json.dumps(cyjs_dict, indent=1, sort_keys=True)
        model_dict = {'exp_colorscale_str': exp_colorscale_str,
                      'mut_colorscale_str': mut_colorscale_str,
                      'model_elements_str': model_str}
        s = ''
        s += 'var exp_colorscale = %s;\n' % model_dict['exp_colorscale_str']
        s += 'var mut_colorscale = %s;\n' % model_dict['mut_colorscale_str']
        s += 'var model_elements = %s;\n' % model_dict['model_elements_str']
        with open(fname, 'wb') as fh:
            fh.write(s.encode('utf-8'))
8845
static void exportModel() throws Exception {
    HttpClient client = new HttpClient();
    GetMethod get = new GetMethod(URL + "/2/ExportModel.json?model=MyInitialNeuralNet");
    int status = client.executeMethod(get);
    if( status != 200 )
      throw new Exception(get.getStatusText());
    JsonObject response = (JsonObject) new JsonParser().parse(new InputStreamReader(get.getResponseBodyAsStream()));
    JsonElement model = response.get("model");
    JsonWriter writer = new JsonWriter(new FileWriter(JSON_FILE));
    writer.setLenient(true);
    writer.setIndent("  ");
    Streams.write(model, writer);
    writer.close();
    get.releaseConnection();
  }
247945
def export(self, node):
        """"""
        attriter = self.attriter or (lambda attr_values: attr_values)
        return self.__export(node, self.dictcls, attriter, self.childiter)
440087
def export_coreml(self, filename):
        
        print('This model is exported as a custom Core ML model. In order to use it in your\n'
              'application, you must also include "libRecommender.dylib". For additional\n'
              'details see:\n'
              'https://apple.github.io/turicreate/docs/userguide/recommender/coreml-deployment.html')

        import turicreate as tc
        self.__proxy__.export_to_coreml(filename)
1119331
def build_model_name(cls, name='modelName', output_name='output'):
        
        obj = cls(name)
        obj.exporter = 'generate_model_name'
        obj.output_name = output_name
        return obj
394685
def model_export(model, file_name, repo=None):
    
    with codecs.open(file_name, 'w', encoding="utf-8") as f:
        model_export_to_file(f, model, repo)
532744
def to_s
     data = [@name.concat(Array.new(32-@name.size, 0)), 
             @name_size, 
             @type, 
             @color, 
             @left, 
             @right, 
             @child, 
             @created,
             @modified, 
             @sector, 
             @size].flatten
      data.pack(PACKING)
    end
570547
function() {
    var model = this._model;
    var arrayTransform = function(result) { // jscs:ignore jsDoc
      return result.rows;
    };
    var modelTransform = function(rows) { // jscs:ignore jsDoc
      return rows.map(model.load.bind(model));
    };

    var dup = this._dup()
      .transform(arrayTransform)
      .transform(modelTransform);

    dup._arrayTransform = arrayTransform;
    dup._modelTransform = modelTransform;

    return dup;
  }
669072
def from_local_name(acs, attr, name_format):
    
    for aconv in acs:
        #print(ac.format, name_format)
        if aconv.name_format == name_format:
            #print("Found a name_form converter")
            return aconv.to_format(attr)
    return attr
892343
private void exportInternalAPI(ClassLoader cl) {
        String[] packages = {
            "com.sun.tools.doclets",
            "com.sun.tools.doclets.standard",
            "com.sun.tools.doclets.internal.toolkit",
            "com.sun.tools.doclets.internal.toolkit.taglets",
            "com.sun.tools.doclets.internal.toolkit.builders",
            "com.sun.tools.doclets.internal.toolkit.util",
            "com.sun.tools.doclets.internal.toolkit.util.links",
            "com.sun.tools.doclets.formats.html",
            "com.sun.tools.doclets.formats.html.markup"
        };

        try {
            Method getModuleMethod = Class.class.getDeclaredMethod("getModule");
            Object thisModule = getModuleMethod.invoke(getClass());

            Class<?> moduleClass = Class.forName("java.lang.Module");
            Method addExportsMethod = moduleClass.getDeclaredMethod("addExports", String.class, moduleClass);

            Method getUnnamedModuleMethod = ClassLoader.class.getDeclaredMethod("getUnnamedModule");
            Object target = getUnnamedModuleMethod.invoke(cl);

            for (String pack : packages) {
                addExportsMethod.invoke(thisModule, pack, target);
            }
        } catch (Exception e) {
            // do nothing
        }
    }
616865
def moveoutletstostrm(np, flowdir, streamRaster, outlet, modifiedOutlet,
                          workingdir=None, mpiexedir=None,
                          exedir=None, log_file=None, runtime_file=None, hostfile=None):
        """"""
        fname = TauDEM.func_name('moveoutletstostrm')
        return TauDEM.run(FileClass.get_executable_fullpath(fname, exedir),
                          {'-p': flowdir, '-src': streamRaster, '-o': outlet},
                          workingdir,
                          None,
                          {'-om': modifiedOutlet},
                          {'mpipath': mpiexedir, 'hostfile': hostfile, 'n': np},
                          {'logfile': log_file, 'runtimefile': runtime_file})
1129050
function exportToHTML(targetDir, exportDiagram) {
    fs.ensureDirSync(targetDir);
    fs.ensureDirSync(targetDir + "/contents");
    fs.ensureDirSync(targetDir + "/diagrams");
    fs.copySync(__dirname + "/../resources/html/assets", targetDir + "/assets");
    // Generate html documents
    try {
        var root = mdjson.getRoot();
        mdjson.render(__dirname + "/../resources/html/templates/index.ejs", targetDir + "/index.html", root, { filters: filters });
        mdjson.render(__dirname + "/../resources/html/templates/navigation.ejs", targetDir + "/contents/navigation.html", root, { filters: filters });
        mdjson.render(__dirname + "/../resources/html/templates/diagrams.ejs", targetDir + "/contents/diagrams.html", root, { filters: filters });
        mdjson.render(__dirname + "/../resources/html/templates/element_index.ejs", targetDir + "/contents/element_index.html", root, { filters: filters });
        mdjson.renderBulk(__dirname + "/../resources/html/templates/content.ejs", targetDir + "/contents/<%=: element | toFilename %>.html", "@Model", { filters: filters }, function (err, file, elem) {
            if (err) {
                console.error(err);
            }
        });
    } catch (err) {
        console.error(err);
    }
    // Export diagram images
    if (exportDiagram) {
        var diagrams = mdjson.Repository.getInstancesOf("Diagram");
        _.each(diagrams, function (d) {
            mdjson.exportDiagramAsSVG(d, targetDir + "/diagrams/" + toFilename(d) + ".svg");
        });
    }
}
831176
def export_html(path="./plot.html", to_png=false)
      path = File.expand_path(path, Dir::pwd)
      body = generate_html("../templates/iruby.erb")
      temp_path = File.expand_path("../templates/static_html.erb", __FILE__)
      template = File.read(temp_path)
      num = File.write(path, ERB.new(template).result(binding))
      "Plot was saved to " + path
    end