Store new network view
@param {string} instance - Package instance ID
@param {string} nodesID - ID of nodes collection
@param {string} nodesName - Name of nodes collection
@param {object} response - Response object
325594
function newNetwork(instance, nodesID, nodesName, response) {
  const viewID = misc.uuidv4().slice(0, 8);
  const edgesID = response.workflowID.slice(0, 8);
  return updateItem(instance, item => {
    item.views.push({
      $schema: "https://mojaie.github.io/kiwiii/specs/network_v1.0.json",
      viewID: viewID,
      name: `${nodesName}_${response.name}`,
      viewType: 'network',
      nodes: nodesID,
      edges: edgesID,
      minConnThld: response.query.params.threshold
    });
    item.dataset.push({
      $schema: "https://mojaie.github.io/kiwiii/specs/collection_v1.0.json",
      collectionID: edgesID,
      name: response.name,
      contents: [response]
    });
  }).then(() => viewID);
}
931327
function destroyInstance (instanceId) {
  var instance = instances[instanceId] || {};
  if (instance.app instanceof Vue$2) {
    instance.app.$destroy();
  }
  delete instances[instanceId];
}
1267498
function tagNodesWithIds (data) {
  let id = 0
  const idsToNodes = new Map()
  const nodesToIds = new Map()
  tagNodes(data)

  return {
    idsToNodes,
    nodesToIds
  }

  function tag (node) {
    idsToNodes.set(id, node)
    nodesToIds.set(node, id)
    id++
  }
  function tagNodes (node) {
    tag(node)
    if (node.children) node.children.forEach(tagNodes)
  }
}
220612
protected function updateNodeResponse(Response $response, ReadNodeInterface $node, Request $request)
    {
        $tagManager = $this->get('open_orchestra_base.manager.tag');
        $cacheableManager = $this->get('open_orchestra_display.manager.cacheable');

        $cacheTags = array(
            $tagManager->formatNodeIdTag($node->getNodeId()),
            $tagManager->formatLanguageTag($node->getLanguage()),
            $tagManager->formatSiteIdTag($node->getSiteId())
        );
        $cacheableManager->addCacheTags($cacheTags);

        $cacheInfo = $this->get('open_orchestra_front.manager.node_response_manager')->getNodeCacheInfo($node);
        $privacy = ($cacheInfo[NodeResponseManager::IS_PUBLIC]) ? CacheableInterface::CACHE_PUBLIC : CacheableInterface::CACHE_PRIVATE;

        if ($this->has('esi') && $this->get('esi')->hasSurrogateCapability($request)) {
            $response = $cacheableManager->setResponseCacheParameters(
                $response,
                (CacheableInterface::CACHE_PUBLIC === $privacy) ? $node->getMaxAge() : 0,
                $privacy,
                true
            );
        } else {
            $response = $cacheableManager->setResponseCacheParameters(
                $response,
                (CacheableInterface::CACHE_PUBLIC === $privacy) ? $cacheInfo[NodeResponseManager::MAX_AGE] : 0,
                $privacy
            );
        }

        return $response;
    }
402707
function registerNode (host, node, insertBefore, func) {
  const index = indexOfNode(host, insertBefore);
  eachNodeOrFragmentNodes(node, (eachNode, eachIndex) => {
    func(eachNode, eachIndex);

    if (canPatchNativeAccessors) {
      nodeToParentNodeMap.set(eachNode, host);
    } else {
      staticProp(eachNode, 'parentNode', host);
    }

    // When childNodes is artificial, do manual house keeping.
    if (Array.isArray(host.childNodes)) {
      if (index > -1) {
        arrProto.splice.call(host.childNodes, index + eachIndex, 0, eachNode);
      } else {
        arrProto.push.call(host.childNodes, eachNode);
      }
    }
  });
}
586807
function BlockTxnPacket(response, witness) {
  if (!(this instanceof BlockTxnPacket))
    return new BlockTxnPacket(response, witness);

  Packet.call(this);

  this.response = response || new bip152.TXResponse();
  this.witness = witness || false;
}
154240
function addInstance(machineName, versionKey) {

        return co(function*() {
            debug("Adding a new instance to the " + versionKey + " of the '" + machineName + "' machine");
            let manifest = getManifest();

            let machine = manifest.machines[machineName];
            if (!machine) {
                throw new Error("Machine does not exists");
            }

            let version = machine.versions[versionKey];
            if (!version) {
                throw new Error("Version does not exists");
            }

            let versionInfo = getVersionInfo(machineName,  versionKey);
            if(!versionInfo.isSealed) {
                throw new Error("The version is not sealed yet");
            }

            let newInstanceKey = "instance" + (Object.keys(version.instances).length + 1);
            let instanceDirPath = version.route + "/instances/" + newInstanceKey;
            let instanceSnapshotsDirPath = instanceDirPath + "/snapshots";
            version.instances[newInstanceKey] = {
                "route": instanceDirPath,
                "snapshots": {}
            };

            let infoFile = instanceDirPath + "/info.json";

            debug("Creating the directories");
            fs.mkdirSync(repositoryPath + "/" + instanceDirPath);
            fs.mkdirSync(repositoryPath + "/" + instanceSnapshotsDirPath);

            debug("Creating the instance info.json file");
            let info = {
                "hasStarted": false,
                "hasEnded": false
            };
            jsonfile.writeFileSync(repositoryPath + "/" + infoFile, info);

            debug("Setting the manifest");
            setManifest(manifest);
            yield _commit(null, ["manifest.json", infoFile],
                "Created the "+newInstanceKey+" for the "+versionKey+" of the '" + machineName + "' machine");

            return newInstanceKey;
        });
    }
1301256
function storeResponse(message, id, dest)
  {
    var response =
    {
      message: message,
      /** Timeout to auto-clean old responses */
      timeout: setTimeout(function()
      {
        responses.remove(id, dest);
      },
      response_timeout)
    };

    responses.set(response, id, dest);
  }
1300563
function refreshInstance (instanceId, data) {
  var instance = instances[instanceId] || {};
  if (!(instance.app instanceof Vue$2)) {
    return new Error(("refreshInstance: instance " + instanceId + " not found!"))
  }
  for (var key in data) {
    Vue$2.set(instance.app, key, data[key]);
  }
  // Finally `refreshFinish` signal needed.
  renderer.sendTasks(instanceId + '', [{ module: 'dom', method: 'refreshFinish', args: [] }], -1);
}
1013162
def show_instance(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_instance action must be called with -a or --action.'
        )

    conn = get_conn()
    node = conn.show_instance(name).__dict__
    __utils__['cloud.cache_node'](node, __active_provider_name__, __opts__)
    return node
590637
public OvhInstanceVnc project_serviceName_instance_instanceId_vnc_POST(String serviceName, String instanceId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/vnc";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		String resp = exec(qPath, "POST", sb.toString(), null);
		return convertTo(resp, OvhInstanceVnc.class);
	}
514995
@GetMapping(path = "/instances/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public Mono<ResponseEntity<Instance>> instance(@PathVariable String id) {
        LOGGER.debug("Deliver registered instance with ID '{}'", id);
        return registry.getInstance(InstanceId.of(id))
                       .filter(Instance::isRegistered)
                       .map(ResponseEntity::ok)
                       .defaultIfEmpty(ResponseEntity.notFound().build());
    }
869690
def show_instance(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_instance action must be called with -a or --action.'
        )
    node = _get_node(name)
    __utils__['cloud.cache_node'](node, __active_provider_name__, __opts__)
    return node
234703
function MultiId(node) {
  this.nodes = Object.create(null);
  this.nodes[node._nid] = node;
  this.length = 1;
  this.firstNode = undefined;
}
1359149
def show_instance(name, call=None):
    '''
    
    '''
    node = get_node(name)
    ret = query(command='my/machines/{0}'.format(node['id']),
                location=node['location'], method='GET')

    return ret
31247
function(nodes) {

        if (!nodes) {
            return;
        }

        var self = this;

        self.nodes = [];

        _.each(nodes, function(node) {
            self.nodes.push(new rackspace.Node(self, node));
        });

        self.nodeCount = self.nodes.length;
    }
1352568
public void project_serviceName_instance_instanceId_snapshot_POST(String serviceName, String instanceId, String snapshotName) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/snapshot";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "snapshotName", snapshotName);
		exec(qPath, "POST", sb.toString(), o);
	}