Internal variant of node_info taking a libvirt connection as parameter
762209
def _node_info(conn):
    '''
    
    '''
    raw = conn.getInfo()
    info = {'cpucores': raw[6],
            'cpumhz': raw[3],
            'cpumodel': six.text_type(raw[0]),
            'cpus': raw[2],
            'cputhreads': raw[7],
            'numanodes': raw[4],
            'phymemory': raw[1],
            'sockets': raw[5]}
    return info
1179017
def _bsp_traverse(
    node_iter: Iterable[tcod.bsp.BSP],
    callback: Callable[[tcod.bsp.BSP, Any], None],
    userData: Any,
) -> None:
    
    for node in node_iter:
        callback(node, userData)
176411
def visit_Name(self, node):
        
        if node.id in self.naming:
            return self.naming[node.id]
        elif node.id in self.global_declarations:
            return [frozenset([self.global_declarations[node.id]])]
        elif isinstance(node.ctx, ast.Param):
            deps = [frozenset()]
            self.naming[node.id] = deps
            return deps
        else:
            raise PythranInternalError("Variable '{}' use before assignment"
                                       "".format(node.id))
365865
func (c *Connect) GetSEVInfo(flags uint32) (*NodeSEVParameters, error) {
	if C.LIBVIR_VERSION_NUMBER < 4005000 {
		return nil, makeNotImplementedError("virNodeGetSEVInfo")
	}

	params := &NodeSEVParameters{}
	info := getNodeSEVFieldInfo(params)

	var cparams *C.virTypedParameter
	var cnparams C.int

	var err C.virError
	ret := C.virNodeGetSEVInfoWrapper(c.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &cnparams, C.uint(flags), &err)
	if ret == -1 {
		return nil, makeError(&err)
	}

	defer C.virTypedParamsFree(cparams, cnparams)

	_, gerr := typedParamsUnpack(cparams, cnparams, info)
	if gerr != nil {
		return nil, gerr
	}

	return params, nil
}
1243983
def _load_nvrtc_lib(self, lib_path):
        
        if sizeof(c_void_p) == 8:
            if system() == 'Windows':
                def_lib_name = 'nvrtc64_92.dll'
            elif system() == 'Darwin':
                def_lib_name = 'libnvrtc.dylib'
            else:
                def_lib_name = 'libnvrtc.so'
        else:
            raise NVRTCException('NVRTC is not supported on 32-bit platforms.')

        if len(lib_path) == 0:
            name = def_lib_name
        else:
            name = lib_path

        self._lib = cdll.LoadLibrary(name)

        self._lib.nvrtcCreateProgram.argtypes = [
            POINTER(c_void_p),  # prog
            c_char_p,           # src
            c_char_p,           # name
            c_int,              # numHeaders
            POINTER(c_char_p),  # headers
            POINTER(c_char_p)   # include_names
        ]
        self._lib.nvrtcCreateProgram.restype = c_int

        self._lib.nvrtcDestroyProgram.argtypes = [
            POINTER(c_void_p)   # prog
        ]
        self._lib.nvrtcDestroyProgram.restype = c_int

        self._lib.nvrtcCompileProgram.argtypes = [
            c_void_p,           # prog
            c_int,              # numOptions
            POINTER(c_char_p)   # options
        ]
        self._lib.nvrtcCompileProgram.restype = c_int

        self._lib.nvrtcGetPTXSize.argtypes = [
            c_void_p,           # prog
            POINTER(c_size_t)   # ptxSizeRet
        ]
        self._lib.nvrtcGetPTXSize.restype = c_int

        self._lib.nvrtcGetPTX.argtypes = [
            c_void_p,           # prog
            c_char_p            # ptx
        ]
        self._lib.nvrtcGetPTX.restype = c_int

        self._lib.nvrtcGetProgramLogSize.argtypes = [
            c_void_p,           # prog
            POINTER(c_size_t)   # logSizeRet
        ]
        self._lib.nvrtcGetProgramLogSize.restype = c_int

        self._lib.nvrtcGetProgramLog.argtypes = [
            c_void_p,           # prog
            c_char_p            # log
        ]
        self._lib.nvrtcGetProgramLog.restype = c_int

        self._lib.nvrtcAddNameExpression.argtypes = [
            c_void_p,           # prog
            c_char_p            # nameExpression
        ]
        self._lib.nvrtcAddNameExpression.restype = c_int

        self._lib.nvrtcGetLoweredName.argtypes = [
            c_void_p,           # prog
            c_char_p,           # nameExpression
            POINTER(c_char_p)   # loweredName
        ]
        self._lib.nvrtcGetLoweredName.restype = c_int

        self._lib.nvrtcGetErrorString.argtypes = [
            c_int               # result
        ]
        self._lib.nvrtcGetErrorString.restype = c_char_p

        self._lib.nvrtcVersion.argtypes = [
            POINTER(c_int),     # major
            POINTER(c_int)      # minor
        ]
        self._lib.nvrtcVersion.restype = c_int
769288
def host_info(host=None):
    '''
    
    '''
    data = query(host, quiet=True)
    for id_ in data:
        if 'vm_info' in data[id_]:
            data[id_].pop('vm_info')
    __jid_event__.fire_event({'data': data, 'outputter': 'nested'}, 'progress')
    return data
231627
private void connectToOneServerWithRetry(String hostname, int port) {
        long sleep = m_initialRetryIntervalMS;
        while (m_shouldContinue.get()) {
            try {
                m_client.createConnection(hostname, port);
                LOG.info(String.format("Connected to VoltDB node at %s:%d.", hostname, port));
                break;
            } catch (Exception e) {
                LOG.warn(String.format("Connection to VoltDB node at %s:%d failed - retrying in %d second(s).",
                        hostname, port, TimeUnit.MILLISECONDS.toSeconds(sleep)));
                try {
                    Thread.sleep(sleep);
                } catch (Exception ignored) {
                }
                if (sleep < m_maxRetryIntervalMS) {
                    sleep = Math.min(sleep + sleep, m_maxRetryIntervalMS);
                }
            }
        }
    }
271866
def virsh_version(self,
                      host_list=None,
                      remote_user=None,
                      remote_pass=None,
                      sudo=False,
                      sudo_user=None,
                      sudo_pass=None):
        '''
        
        '''
        host_list, remote_user, remote_pass, \
            sudo, sudo_user, sudo_pass = self.get_validated_params(
               host_list, remote_user, remote_pass, sudo, sudo_user,
               sudo_pass)


        result, failed_hosts = self.runner.ansible_perform_operation(
            host_list=host_list,
            remote_user=remote_user,
            remote_pass=remote_pass,
            module="command",
            module_args="virsh version",
            sudo=sudo,
            sudo_user=sudo_user,
            sudo_pass=sudo_pass)

        virsh_result = None

        if result['contacted'].keys():
            virsh_result = {}
            for node in result['contacted'].keys():
                nodeobj = result['contacted'][node]
                jsonoutput = rex.parse_lrvalue_string(nodeobj['stdout'], ":")
                virsh_result[node] = {}
                virsh_result[node]['result'] = jsonoutput

        return virsh_result
910851
function getPlatformVariant() {
  var contents = '';

  if (process.platform !== 'linux') {
    return '';
  }

  try {
    contents = fs.readFileSync(process.execPath);

    // Buffer.indexOf was added in v1.5.0 so cast to string for old node
    // Delay contents.toStrings because it's expensive
    if (!contents.indexOf) {
      contents = contents.toString();
    }

    if (contents.indexOf('libc.musl-x86_64.so.1') !== -1) {
      return 'musl';
    }
  } catch (err) { } // eslint-disable-line no-empty

  return '';
}
619001
function(details, callback) {
        var self = this;

        // Required arguments
        var lb = {
            name: details.name,
            nodes: details.nodes,
            protocol: details.protocol ? details.protocol.name : '',
            port: details.protocol ? details.protocol.port : '',
            virtualIps: details.virtualIps
        };

        if (details.accessList) {
            lb.accessList = details.accessList;
        }

        if (details.algorithm) {
            lb.algorithm = details.algorithm;
        }

        if (details.connectionLogging) {
            lb.connectionLogging = details.connectionLogging;
        }

        if (details.connectionThrottle) {
            lb.connectionThrottle = details.connectionThrottle;
        }

        if (details.healthMonitor) {
            lb.healthMonitor = details.healthMonitor;
        }

        if (details.metadata) {
            lb.metadata = details.metadata;
        }

        if (details.timeout) {
            lb.timeout = details.timeout;
        }

        if (details.sessionPersistence) {
            lb.sessionPersistence = details.sessionPersistence;
        }

        var validationErrors = validateLbInputs(lb);

        if (validationErrors) {
            callback(validationErrors);
            return;
        }

        var requestOptions = {
            uri: '/loadbalancers',
            method: 'POST',
            data: {
                loadBalancer: lb
            },
            endpoint: rackspace.Endpoints.CloudLoadBalancer
        };

        self.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || !body.loadBalancer) {
                callback(err ? err : body);
                return;
            }

            callback(err, new rackspace.LoadBalancer(self, body.loadBalancer));
        });
    }
901787
def _add_path_traversal_strings(self, lib):
        '''
        
        '''
        entries = [
            (('/etc/passwd', 'absolute - /etc/passwd')),
            (('./../../../../../../../../../../../../../../etc/passwd', 'relative - /etc/passwd')),
            (('../../../../../../../../../../../../../../etc/passwd', 'relative - /etc/passwd')),
            (('/proc/cpuinfo', 'absolute path - /proc/cpuinfo')),
            (('./../../../../../../../../../../../../../../proc/cpuinfo', 'relative - /proc/cpuinfo')),
            (('../../../../../../../../../../../../../../proc/cpuinfo', 'relative - /proc/cpuinfo')),
            (('~/.profile', 'absolute - home')),
            (('$HOME/.profile', 'environment - home')),
            (('/../../../../../../../../../../../../boot.ini', 'relative - boot.ini')),
        ]
        for (s, desc) in entries:
            lib.append((s, 'path traversal - %s' % desc))
708451
def visit_Name(self, node):
        
        if (isinstance(node.ctx, ast.Load) and
                node.id not in self.local_decl and
                node.id in self.to_expand):
            self.update = True
            return ast.Call(func=node,
                            args=[], keywords=[])
        return node
518414
def _fix_orig_vcf_refs(data):
    
    variantcaller = tz.get_in(("config", "algorithm", "variantcaller"), data)
    if variantcaller:
        data["vrn_file_orig"] = data["vrn_file"]
    for i, sub in enumerate(data.get("group_orig", [])):
        sub_vrn = sub.pop("vrn_file", None)
        if sub_vrn:
            sub["vrn_file_orig"] = sub_vrn
            data["group_orig"][i] = sub
    return data
1194008
function generatePackageInformation( &$packageInformation, $package, $http, $step, &$persistentData )
    {
        $nodeList = $persistentData['node_list'];
        $options = $persistentData['object_options'];
        $nodeCount = 0;
        $description = 'This package contains the following nodes :' . "\n";
        $nodeNames = array();
        foreach( $nodeList as $nodeInfo )
        {
            $contentNode = eZContentObjectTreeNode::fetch( $nodeInfo['id'] );
            $description .= $contentNode->attribute( 'name' ) . ' - ' . $nodeInfo['type'] . "\n";
            $nodeNames[] = trim( $contentNode->attribute( 'name' ) );
            if ( $nodeInfo['type'] == 'node' )
            {
                ++$nodeCount;
            }
            else if ( $nodeInfo['type'] == 'subtree' )
            {
                $nodeCount += $contentNode->subTreeCount();
            }
        }

        $packageInformation['name'] = implode( ',', $nodeNames );
        $packageInformation['summary'] = implode( ', ', $nodeNames );
        $packageInformation['description'] = $description;
    }
762473
def element_info(cls_or_slf, node, siblings, level, value_dims):
        
        info = cls_or_slf.component_type(node)
        if len(node.kdims) >= 1:
            info += cls_or_slf.tab + '[%s]' % ','.join(d.name for d in node.kdims)
        if value_dims and len(node.vdims) >= 1:
            info += cls_or_slf.tab + '(%s)' % ','.join(d.name for d in node.vdims)
        return level, [(level, info)]
718470
function getNodeInfo(x, y){
        var nodeInfo = {};
        var bestNodeInfo = {
            node: null,
            boundSize: 0
        };
        getBestNode(appTree, x, y, bestNodeInfo);
        var bestNode = bestNodeInfo.node;
        if(bestNode){
            var text = bestNode.text || bestNode.label;
            if(text){
                text = text.replace(/\s*\r?\n\s*/g,' ');
                text = text.replace(/^\s+|\s+$/g, '');
                var textLen = byteLen(text);
                text = textLen > 20 ? leftstr(text, 20) + '...' : text;
                nodeInfo.text = text;
            }
            nodeInfo.path = getNodeXPath(bestNode);
        }
        else{
            nodeInfo.x = x;
            nodeInfo.y = y;
        }
        return nodeInfo;
    }
846514
def node(self, source, args=(), env={}):
        

        return self._exec(self.node_bin, source, args=args, env=env)