Checks whether the compiler is actually clang masquerading as gcc
(e.g., the situation on OS X 10.9 Mavericks).
163620
private boolean isClang() {
    final String command = getCommand();
    if (command == null) {
      return false;
    }
    if (command.startsWith("clang")) {
      return true;
    }
    if (!GPP_COMMAND.equals(command)) {
      return false;
    }
    final String[] cmd = {
        command, "--version"
    };
    final String[] cmdout = CaptureStreamHandler.execute(cmd).getStdout();
    return cmdout != null && cmdout.length > 0 && cmdout[0].contains("(clang-");
  }
958533
def compiler():
    
    cfg_cxx = str(cfg.get('compiler', 'CXX'))
    if not cfg_cxx:
        cfg_cxx = None
    return os.environ.get('CXX', cfg_cxx) or None
275889
private static boolean classExists(TypeDef typeDef) {
       try {
        Class.forName(typeDef.getFullyQualifiedName());
        return true;
       } catch (ClassNotFoundException e) {
           return false;
       }
    }
657463
def is_const(*p):
    
    return is_SYMBOL('VAR', *p) and all(x.class_ == CLASS.const for x in p)
1078101
public boolean compileIsModified()
  {
    if (_compileIsModified)
      return true;

    CompileThread compileThread = new CompileThread();
    ThreadPool.current().start(compileThread);

    try {
      synchronized (compileThread) {
        if (! compileThread.isDone())
          compileThread.wait(5000);
      }

      if (_compileIsModified)
        return true;
      else if (compileThread.isDone()) {
        //setDependPath(getClassPath());

        return reloadIsModified();
      }
      else
        return true;
    } catch (Throwable e) {
    }

    return false;
  }
906371
private boolean isPEI(InstructionHandle handle) throws CFGBuilderException {
        Instruction ins = handle.getInstruction();

        if (!(ins instanceof ExceptionThrower)) {
            return false;
        }

        if (ins instanceof NEW) {
            return false;
        }
        // if (ins instanceof ATHROW) return false;
        if (ins instanceof GETSTATIC) {
            return false;
        }
        if (ins instanceof PUTSTATIC) {
            return false;
        }
        if (ins instanceof ReturnInstruction) {
            return false;
        }
        if (ins instanceof INSTANCEOF) {
            return false;
        }
        if (ins instanceof MONITOREXIT) {
            return false;
        }
        if (ins instanceof LDC) {
            return false;
        }
        if (ins instanceof GETFIELD && !methodGen.isStatic()) {
            // Assume that GETFIELD on this object is not PEI
            return !isSafeFieldSource(handle.getPrev());
        }
        if (ins instanceof PUTFIELD && !methodGen.isStatic()) {
            // Assume that PUTFIELD on this object is not PEI
            int depth = ins.consumeStack(cpg);
            for(InstructionHandle prev = handle.getPrev(); prev != null; prev = prev.getPrev()) {
                Instruction prevInst = prev.getInstruction();
                if(prevInst instanceof BranchInstruction) {
                    if(prevInst instanceof GotoInstruction) {
                        // Currently we support only jumps to the PUTFIELD itself
                        // This will cover simple cases like this.a = flag ? foo : bar
                        if(((BranchInstruction) prevInst).getTarget() == handle) {
                            depth = ins.consumeStack(cpg);
                        } else {
                            return true;
                        }
                    } else if (!(prevInst instanceof IfInstruction)) {
                        // As IF instructions may fall through then the stack depth remains unchanged
                        // Actually we should not go here for normal Java bytecode: switch or jsr should not appear in this context
                        return true;
                    }
                }
                depth = depth - prevInst.produceStack(cpg) + prevInst.consumeStack(cpg);
                if(depth < 1) {
                    throw new CFGBuilderException("Invalid stack at "+prev+" when checking "+handle);
                }
                if(depth == 1) {
                    InstructionHandle prevPrev = prev.getPrev();
                    if(prevPrev != null && prevPrev.getInstruction() instanceof BranchInstruction) {
                        continue;
                    }
                    return !isSafeFieldSource(prevPrev);
                }
            }
        }
        return true;
    }
9294
def pre_build_check():
    
    if os.environ.get('CASS_DRIVER_NO_PRE_BUILD_CHECK'):
        return True

    try:
        from distutils.ccompiler import new_compiler
        from distutils.sysconfig import customize_compiler
        from distutils.dist import Distribution

        # base build_ext just to emulate compiler option setup
        be = build_ext(Distribution())
        be.initialize_options()
        be.finalize_options()

        # First, make sure we have a Python include directory
        have_python_include = any(os.path.isfile(os.path.join(p, 'Python.h')) for p in be.include_dirs)
        if not have_python_include:
            sys.stderr.write("Did not find 'Python.h' in %s.\n" % (be.include_dirs,))
            return False

        compiler = new_compiler(compiler=be.compiler)
        customize_compiler(compiler)

        try:
            # We must be able to initialize the compiler if it has that method
            if hasattr(compiler, "initialize"):
                compiler.initialize()
        except:
            return False

        executables = []
        if compiler.compiler_type in ('unix', 'cygwin'):
            executables = [compiler.executables[exe][0] for exe in ('compiler_so', 'linker_so')]
        elif compiler.compiler_type == 'nt':
            executables = [getattr(compiler, exe) for exe in ('cc', 'linker')]

        if executables:
            from distutils.spawn import find_executable
            for exe in executables:
                if not find_executable(exe):
                    sys.stderr.write("Failed to find %s for compiler type %s.\n" % (exe, compiler.compiler_type))
                    return False

    except Exception as exc:
        sys.stderr.write('%s\n' % str(exc))
        sys.stderr.write("Failed pre-build check. Attempting anyway.\n")

    # if we are unable to positively id the compiler type, or one of these assumptions fails,
    # just proceed as we would have without the check
    return True
86329
def is_build_linked(source, pkg):
        
        for line in source.split("\n"):
            if re.search(r"(api|compile)\s+project\(['\"]:{}['\"]\)".format(pkg),
                         line):
                return True
        return False
166027
def is_defined(self, objtxt, force_import=False):
        """"""
        return self.interpreter.is_defined(objtxt, force_import)
63516
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
            if (isTypeAny(funcType)) {
                return true;
            }
            if (isTypeAny(apparentFuncType) && funcType.flags & 16384 /* TypeParameter */) {
                return true;
            }
            if (!numCallSignatures && !numConstructSignatures) {
                // We exclude union types because we may have a union of function types that happen to have
                // no common signatures.
                if (funcType.flags & 524288 /* Union */) {
                    return false;
                }
                return isTypeAssignableTo(funcType, globalFunctionType);
            }
            return false;
        }
1312388
public static boolean checkSasAgreement(Platform platform, byte[] aMsg, int sasPos,
			int sasCount) {
		if (sasCount != 2)
			return false;
		
		boolean result =  (platform.getUtils().equals(SasType.B256.getType(), 0, aMsg, sasPos , 4)  &&
			    platform.getUtils().equals(SasType.B32.getType(), 0, aMsg, sasPos + 1 * 4, 4));
		
		return result;
	}
968953
def has_flag(compiler, flagname):
    
    with TemporaryDirectory() as tmpdir, \
            stdchannel_redirected(sys.stderr, os.devnull), \
            stdchannel_redirected(sys.stdout, os.devnull):
        f = tempfile.mktemp(suffix='.cpp', dir=tmpdir)
        with open(f, 'w') as fh:
            fh.write('int main (int argc, char **argv) { return 0; }')
        try:
            compiler.compile([f], extra_postargs=[flagname], output_dir=tmpdir)
        except setuptools.distutils.errors.CompileError:
            return False
    return True
1351723
public boolean isEUI64(boolean asMAC) {
		if(isExtended()) {//getSegmentCount() == EXTENDED_UNIQUE_IDENTIFIER_64_SEGMENT_COUNT
			MACAddressSection section = getSection();
			MACAddressSegment seg3 = section.getSegment(3);
			MACAddressSegment seg4 = section.getSegment(4);
			return seg3.matches(0xff) && seg4.matches(asMAC ? 0xff : 0xfe);
		}
		return false;
	}
1143385
public static function isSupportedShell()
    {
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
        }

        return defined('STDOUT') && function_exists('posix_isatty') && posix_isatty(STDOUT);
    }
889190
def check_syntax(code):
    """"""
    try:
        return compile(code, '<string>', 'exec', dont_inherit=True)
    except (SyntaxError, TypeError, ValueError):
        return False
1162606
public static function verify()
    {
        // PHP interpreter version
        self::checkSystemVersion();

        // BCMath
        self::isFunctionExists('bcmul', self::getErrorMessage('bcmath'));
        self::isFunctionExists('bcdiv', self::getErrorMessage('bcmath'));

        // Filter
        self::isFunctionExists('filter_var', self::getErrorMessage('filter'));

        // Hash
        self::isFunctionExists('hash', self::getErrorMessage('hash'));

        // XMLReader
        self::isClassExists('XMLReader', self::getErrorMessage('xmlreader'));

        // XMLWriter
        if (\Genesis\Config::getInterface('builder') == 'xml') {
            self::isClassExists('XMLWriter', self::getErrorMessage('xmlwriter'));
        }

        // cURL
        if (\Genesis\Config::getInterface('network') == 'curl') {
            self::isFunctionExists('curl_init', self::getErrorMessage('curl'));
        }
    }
275718
def ismatch(self, s):
        
        if self._ismatchfun(s) and self._compiled_pattern.match(s):
            return True
        return False