Save this node (and all its attributes) to config
544546
def save(self):
        
        cfg_file = "/etc/nago/nago.ini"
        config = ConfigParser.ConfigParser()
        config.read(cfg_file)
        result = {}
        token = self.data.pop("token", self.token)
        if token != self._original_token:
            config.remove_section(self._original_token)
            config.add_section(token)

        if token not in config.sections():
            config.add_section(token)
        for key, value in self.data.items():
            config.set(token, key, value)
        for key, value in config.items(token):
            if key not in self.data:
                config.set(token, key, None)
        with open(cfg_file, 'w') as f:
            return config.write(f)
705953
def save_config(config):
    

    configfile = get_configfile()

    if not os.path.exists(configfile):
        configdir = os.path.dirname(configfile)

        if not os.path.exists(configdir):
            os.makedirs(configdir)

    data = config

    with open(configfile, 'wb') as f:
        json.dump(data, f, indent=2)
339399
def save(self, file=CONFIG_FILE):
        
        os.makedirs(os.path.dirname(file), exist_ok=True)
        with open(file, "w") as f:
            yaml.dump(self._settings, f, Dumper=yaml.RoundTripDumper, width=float("inf"))
665620
function Attribute(config) {
        var self = this, c = self.constructor;    // save user config
        // save user config
        self.userConfig = config;    // define
        // define
        while (c) {
            addAttrs(self, c.ATTRS);
            c = c.superclass ? c.superclass.constructor : null;
        }    // initial attr
        // initial attr
        initAttrs(self, config);
    }
1176243
def save(self, path):
        """"""
        to_save = {}
        for x in self.param_names:
            attr = self.__getattribute__(x)
            if type(attr) == np.ndarray:
                attr = [[float(x) for x in row] for row in attr]
            elif isinstance(attr, types.FunctionType):
                attr = attr.__name__
            to_save[x] = attr

        json.dump(to_save, open(path, 'w'))
185406
def save(self, filename=None, debug=False):
        """"""
        if not filename: filename = self.name
        with open(filename, "w") as f: # save config data file
            f.write(self.toJson(self.attrs))
        if self.debug or debug:
            print("saved configuration %s"%(self.name))
            for k,v in sorted(iteritems(self.attrs)):
                print("%15s : %s"%(k,v))
106680
def save(self):
        
        with open(self._user_config_file, 'w', encoding='utf-8') as f:
            self.write(f)
206053
def dump(node, config):
    
    if config.is_node(node):
        fields = OrderedDict()
        for name in config.fields_iter(node):
            attr = config.field_val(node, name)
            if attr is not None:
                fields[name] = dump(attr, config)
        return {"type": config.node_type(node), "data": fields}
    elif config.is_list(node):
        return [dump(x, config) for x in config.list_iter(node)]
    else:
        return config.leaf_val(node)
978241
def store(self, config_file):
        

        selfcopy = copy.deepcopy(self)
        selfcopy.filter_exports()

        with open(config_file, 'w') as outf:
            yaml.dump(
                selfcopy.node,
                outf,
                width=80,
                indent=4,
                default_flow_style=False,
                Dumper=ConfigDumper)
590946
def save(self):
		
		with open(self.configuration_file, 'w') as file_h:
			file_h.write(self._serializer('dumps', self._storage))
1302366
def build_configuration(env=nil)
      result = config_attributes[:default]
      result.deep_merge!(config_attributes[env.to_sym]) if env
      Entity.create(result)
    end
824120
public function save()
    {
        $this->getHandler()->write($this->getId(), serialize($this->attributes));
        $this->started = false;
    }
1000033
def save_config
      config = $bot[:config].clone
      config.delete :client
      File.open "./#{Twittbot::CONFIG_FILE_NAME}", 'w' do |f|
        f.write config.to_yaml
      end
    end
1068631
def parse_config(self):
        
        tree = ElementTree.parse(self.file_xml)
        root = tree.getroot()
        for server in root.findall('server'):
            destination = server.text
            name = server.get("name")
            self.discover_remote(destination, name)
990871
def save_xml(self, doc, element):
        ''''''
        element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'x', str(self.x))
        element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'y', str(self.y))
        element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'height',
                               str(self.height))
        element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'width',
                               str(self.width))
        element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'direction',
                               dir.to_string(self.direction).lower())
58998
def save(self):
        
        LOGGER.debug("Node.save")
        if self.container is not None:
            if self.container.id is None:
                self.container.save()
            self.container_id = self.container.id

        if self.parent_node is not None:
            if self.parent_node.id is None:
                self.parent_node.save()
            self.parent_node_id = self.parent_node.id

        post_payload = {}
        consolidated_twin_nodes_id = []
        consolidated_properties = {}
        consolidated_node_properties = []

        if self.id is not None:
            post_payload['nodeID'] = self.id

        if self.name is not None:
            post_payload['nodeName'] = self.name

        if self.container_id is not None:
            post_payload['nodeContainerID'] = self.container_id

        if self.parent_node_id is not None:
            post_payload['nodeParentNodeID'] = self.parent_node_id

        if self.child_nodes_id is not None:
            post_payload['nodeChildNodesID'] = self.child_nodes_id

        if self.twin_nodes_id is not None:
            consolidated_twin_nodes_id = copy.deepcopy(self.twin_nodes_id)
        if self.twin_nodes_2_rm is not None:
            for twin_node_2_rm in self.twin_nodes_2_rm:
                if twin_node_2_rm.id is None:
                    twin_node_2_rm.sync()
                consolidated_twin_nodes_id.remove(twin_node_2_rm.id)
        if self.twin_nodes_2_add is not None:
            for twin_node_2_add in self.twin_nodes_2_add:
                if twin_node_2_add.id is None:
                    twin_node_2_add.save()
                consolidated_twin_nodes_id.append(twin_node_2_add.id)
        post_payload['nodeTwinNodesID'] = consolidated_twin_nodes_id

        if self.endpoints_id is not None:
            post_payload['nodeEndpointsID'] = self.endpoints_id

        if self.properties is not None:
            consolidated_properties = copy.deepcopy(self.properties)
        if self.properties_2_rm is not None:
            for n_property_name in self.properties_2_rm:
                consolidated_properties.pop(n_property_name, 0)
        if self.properties_2_add is not None:
            for n_property_tuple in self.properties_2_add:
                consolidated_properties[n_property_tuple[0]] = n_property_tuple[1]
        if consolidated_properties.__len__() > 0:
            for key, value in consolidated_properties.items():
                    consolidated_node_properties.append(DriverTools.property_params(key, value))
        post_payload['nodeProperties'] = consolidated_node_properties

        params = SessionService.complete_transactional_req({'payload': json.dumps(post_payload)})
        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            params['OPERATION'] = 'createNode'
            args = {'properties': params}
        else:
            args = {
                'http_operation': 'POST',
                'operation_path': '',
                'parameters': params
            }

        response = NodeService.requester.call(args)

        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            response = response.get()

        if response.rc != 0:
            LOGGER.warning('Node.save - Problem while saving node' + self.name +
                           '. Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) +
                           " (" + str(response.rc) + ")")
            if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                raise ArianeMappingOverloadError("Node.save",
                                                 ArianeMappingOverloadError.ERROR_MSG)
            # traceback.print_stack()
        else:
            self.id = response.response_content['nodeID']
            if self.twin_nodes_2_add is not None:
                for twin_node_2_add in self.twin_nodes_2_add:
                    twin_node_2_add.sync()
            if self.twin_nodes_2_rm is not None:
                for twin_node_2_rm in self.twin_nodes_2_rm:
                    twin_node_2_rm.sync()
            if self.container is not None:
                self.container.sync()
            if self.parent_node is not None:
                self.parent_node.sync()
            self.sync(json_obj=response.response_content)
        self.twin_nodes_2_add.clear()
        self.twin_nodes_2_rm.clear()
        self.properties_2_add.clear()
        self.properties_2_rm.clear()
1150389
def Preserve(self):
        
        ret = libxml2mod.xmlTextReaderPreserve(self._o)
        if ret is None:raise treeError('xmlTextReaderPreserve() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp