Get a usable clang++ plumbum command.

    This searches for a usable clang++ in the llvm binary path

    Returns:
        plumbum Command that executes clang++
439086
def compiler(name):
    
    pinfo = __get_paths()
    _compiler = local[name]
    _compiler = _compiler.setenv(
        PATH=pinfo["path"], LD_LIBRARY_PATH=pinfo["ld_library_path"])
    return _compiler
765968
def _get_cl_version(p, config):
    
    if not p.get("has_cl_version", True):
        return ""
    try:
        prog = config_utils.get_program(p["cmd"], config)
    except config_utils.CmdNotFound:

        localpy_cmd = os.path.join(os.path.dirname(sys.executable), p["cmd"])
        if os.path.exists(localpy_cmd):
            prog = localpy_cmd
        else:
            return ""
    args = p.get("args", "")

    cmd = "{prog} {args}"
    subp = subprocess.Popen(cmd.format(**locals()), stdout=subprocess.PIPE,
                            stderr=subprocess.STDOUT,
                            shell=True)
    with contextlib.closing(subp.stdout) as stdout:
        if p.get("stdout_flag"):
            v = _parse_from_stdoutflag(stdout, p["stdout_flag"])
        elif p.get("paren_flag"):
            v = _parse_from_parenflag(stdout, p["paren_flag"])
        else:
            lines = [l.strip() for l in str(stdout.read()).split("\n") if l.strip()]
            v = lines[-1]
    if v.endswith("."):
        v = v[:-1]
    return v
602539
function find(dirname, args, cb) {
    var spawned = execFile(
        '/usr/bin/find',
        ['./'].concat(args),
        {
            maxBuffer: 4000*1024,
            cwd: dirname,
        },
        execHandler(cb)
    );

    // Handle error
    spawned.once('error', cb);
}
1278026
def get_pymodule(self):
        """"""
        msg = None
        code = self.code
        tries = 0
        while True:
            try:
                if tries == 0 and self.resource is not None and \
                   self.resource.read() == code:
                    return self.project.get_pymodule(self.resource,
                                                     force_errors=True)
                return libutils.get_string_module(
                    self.project, code, resource=self.resource,
                    force_errors=True)
            except exceptions.ModuleSyntaxError as e:
                if msg is None:
                    msg = '%s:%s %s' % (e.filename, e.lineno, e.message_)
                if tries < self.maxfixes:
                    tries += 1
                    self.commenter.comment(e.lineno)
                    code = '\n'.join(self.commenter.lines)
                else:
                    raise exceptions.ModuleSyntaxError(
                        e.filename, e.lineno,
                        'Failed to fix error: {0}'.format(msg))
993486
def get_command(self, ctx, name):
        """"""
        plugin = os.path.basename(self.folder)
        try:
            command = importlib.import_module("honeycomb.commands.{}.{}".format(plugin, name))
        except ImportError:
            raise click.UsageError("No such command {} {}\n\n{}".format(plugin, name, self.get_help(ctx)))
        return getattr(command, name)
565431
def find_libjvm(self, java_home):
        
        found_jamvm = False
        non_supported_jvm = ('cacao', 'jamvm')
        found_non_supported_jvm = False

        # Look for the file
        for root, _, names in os.walk(java_home):
            if self._libfile in names:
                # Found it, but check for non supported jvms
                candidate = os.path.split(root)[1]
                if candidate in non_supported_jvm:
                    found_non_supported_jvm = True
                    continue # maybe we will find another one?
                return os.path.join(root, self._libfile)

        else:
            if found_non_supported_jvm:
                raise JVMNotSupportedException("Sorry '{0}' is known to be "
                                               "broken. Please ensure your "
                                               "JAVA_HOME contains at least "
                                               "another JVM implementation "
                                               "(eg. server)"
                                               .format(candidate))
            # File not found
            raise JVMNotFoundException("Sorry no JVM could be found. "
                                       "Please ensure your JAVA_HOME "
                                       "environment variable is pointing "
                                       "to correct installation.")
895980
Command get_command(final String cmd_name) throws DevFailed {
	Command ret_cmd = null;
	final Vector cmd_list = device_class.get_command_list();
	for (int i = 0; i < cmd_list.size(); i++) {
	    final Command cmd = (Command) cmd_list.elementAt(i);
	    if (cmd.get_name().toLowerCase().equals(cmd_name.toLowerCase())) {
		ret_cmd = cmd;
	    }
	}

	if (ret_cmd == null) {
	    Except.throw_exception("API_CommandNotFound", "Command " + cmd_name + " not found",
		    "DeviceImpl.get_command");
	}

	return ret_cmd;
    }
138557
def get_abbr_impl(env):
    """"""
    impl = env.python_implementation

    if impl == "PyPy":
        return "pp"
    elif impl == "Jython":
        return "jy"
    elif impl == "IronPython":
        return "ip"
    elif impl == "CPython":
        return "cp"

    raise LookupError("Unknown Python implementation: " + impl)
421166
def console_getfd(self, ttynum=-1):
        

        if not self.running:
            return False

        return _lxc.Container.console_getfd(self, ttynum)
1312998
def get_abbr_impl():
    """"""
    impl = platform.python_implementation()
    if impl == 'PyPy':
        return 'pp'
    elif impl == 'Jython':
        return 'jy'
    elif impl == 'IronPython':
        return 'ip'
    elif impl == 'CPython':
        return 'cp'

    raise LookupError('Unknown Python implementation: ' + impl)
424664
def get_fn_plan(callback=None, out_callback=None, name='pycbc_cufft', parameters=None):
    
    if parameters is None:
        parameters = []
    source = fftsrc.render(input_callback=callback, output_callback=out_callback, parameters=parameters)
    path = compile(source, name)
    lib = ctypes.cdll.LoadLibrary(path)
    fn = lib.execute
    fn.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]
    plan = lib.create_plan
    plan.restype = ctypes.c_void_p
    plan.argyptes = [ctypes.c_uint]
    return fn, plan
921930
def _get_cromwell_execution_dir(base_dir, target_glob):
    
    cur_dir = glob.glob(os.path.join(base_dir, target_glob))[0]
    if os.path.exists(os.path.join(cur_dir, "cwl.output.json")):
        return base_dir
    else:
        symlink_dir = os.path.dirname(os.path.realpath(os.path.join(cur_dir, "script")))
        ref_base = os.path.dirname(base_dir)
        new_guid = symlink_dir[symlink_dir.find(ref_base) + len(ref_base) + 1:].split("/")[0]
        return _get_cromwell_execution_dir(os.path.join(ref_base, new_guid), target_glob)
1020178
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
                        header_filter, extra_arg, extra_arg_before, quiet,
                        config):
  """"""
  start = [clang_tidy_binary]
  if header_filter is not None:
    start.append('-header-filter=' + header_filter)
  else:
    # Show warnings in all in-project headers by default.
    start.append('-header-filter=^' + build_path + '/.*')
  if checks:
    start.append('-checks=' + checks)
  if tmpdir is not None:
    start.append('-export-fixes')
    # Get a temporary file. We immediately close the handle so clang-tidy can
    # overwrite it.
    (handle, name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
    os.close(handle)
    start.append(name)
  for arg in extra_arg:
      start.append('-extra-arg=%s' % arg)
  for arg in extra_arg_before:
      start.append('-extra-arg-before=%s' % arg)
  start.append('-p=' + build_path)
  if quiet:
      start.append('-quiet')
  if config:
      start.append('-config=' + config)
  start.append(f)
  return start
748461
def get_recipe_env(self, arch, with_flags_in_cc=True):
        
        env = super(ScryptRecipe, self).get_recipe_env(arch, with_flags_in_cc)
        openssl_recipe = self.get_recipe('openssl', self.ctx)
        env['CFLAGS'] += openssl_recipe.include_flags(arch)
        env['LDFLAGS'] += ' -L{}'.format(self.ctx.get_libs_dir(arch.arch))
        env['LDFLAGS'] += ' -L{}'.format(self.ctx.libs_dir)
        env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch)
        env['LIBS'] = env.get('LIBS', '') + openssl_recipe.link_libs_flags()
        return env
981754
function getModulesAnswered(command, argv, globs) {
  let modulesCalled = {};
  let modulesAnswered = [];

  globs.forEach(pkg => {
    const dirName = path.dirname(pkg);
    let pkgJson = {};
    let module;

    try {
      module = require(dirName);
      pkgJson = require(pkg);
    } catch (err) {
      logger.verbose(`Error loading module: ${pkg}`);
    }

    if (module && typeof module.runCommand === 'function') {
      const pkgName = pkgJson.name || dirName;

      if (modulesCalled[pkgName]) {
        logger.verbose(`Multiple instances found. Skipping passing command to ${pkgName}`);
      } else {
        logger.verbose(`Passing command to ${pkgName}`);

        modulesCalled[pkgName] = true;
        if (module.runCommand(command, argv)) {
          modulesAnswered.push(pkgName);
        }

      }
    }
  });

  return modulesAnswered;
}
476469
def getExitCode(self, command, env={}, path=None, uid=None, gid=None,
                    usePTY=0, childFDs=None):
        
        deferred = defer.Deferred()
        processProtocol = _SummaryProcessProtocol(deferred)
        self.execute(processProtocol, command, env, path, uid, gid,
                     usePTY, childFDs)
        @deferred.addCallback
        def getStdOut(tuple_):
            _stdout, _stderr, exitCode = tuple_
            return exitCode
        return deferred
882505
def get_pip_freeze()
      pip_path = ::File.join(@name, 'bin', 'pip')
      tmp = @runner.run_command("#{pip_path} freeze")
      @pip_freeze = Hash.new()
      if tmp.exit_status.to_i != 0
        return @pip_freeze
      end
      lines = tmp.stdout.split("\n")
      lines.each do |line|
        line.strip!
        if line =~ /^-e /
          @pip_freeze[line] = ''
          next
        end
        parts = line.split(/==/)
        @pip_freeze[parts[0]] = parts[1]
      end
      @pip_freeze
    end