Return Hip string if already compiled else compile it.
437494
def compile(self):
        """"""
        if self.buffer is None:
            self.buffer = self._compile_value(self.data, 0)

        return self.buffer.strip()
923215
function _is_compiled($resource_name, $compile_path)
	{
		if (!$this->force_compile && file_exists($compile_path)) {
			if (!$this->compile_check) {
				// no need to check compiled file
				return true;
			} else {
				// get file source and timestamp
				$_params = array('resource_name' => $resource_name, 'get_source'=>false);
				if (!$this->_fetch_resource_info($_params)) {
					return false;
				}
				if ($_params['resource_timestamp'] <= filemtime($compile_path)) {
					// template not expired, no recompile
					return true;
				} else {
					// compile template
					return false;
				}
			}
		} else {
			// compiled template does not exist, or forced compile
			return false;
		}
	}
1265809
def get_py_file_if_possible(pyc_name):
    """"""
    if pyc_name.endswith(('.py', '.so', '.pyd')):
        return pyc_name
    assert pyc_name.endswith('.pyc')
    non_compiled_file = pyc_name[:-1]
    if os.path.exists(non_compiled_file):
        return non_compiled_file
    return pyc_name
168996
def regex(self):
        """"""
        if not self._compiled_regex:
            self._compiled_regex = re.compile(self.raw)
        return self._compiled_regex
883199
def _real_re_compile(self, *args, **kwargs):
        """"""
        try:
            return _real_re_compile(*args, **kwargs)
        except re.error as e:
            # raise InvalidPattern instead of re.error as this gives a
            # cleaner message to the user.
            raise InvalidPattern('"' + args[0] + '" ' +str(e))
939094
def get_module_constant(module, symbol, default=-1, paths=None):
    """"""

    try:
        f, path, (suffix, mode, kind) = find_module(module, paths)
    except ImportError:
        # Module doesn't exist
        return None

    try:
        if kind == PY_COMPILED:
            f.read(8)  # skip magic & date
            code = marshal.load(f)
        elif kind == PY_FROZEN:
            code = imp.get_frozen_object(module)
        elif kind == PY_SOURCE:
            code = compile(f.read(), path, 'exec')
        else:
            # Not something we can parse; we'll have to import it.  :(
            if module not in sys.modules:
                imp.load_module(module, f, path, (suffix, mode, kind))
            return getattr(sys.modules[module], symbol, None)

    finally:
        if f:
            f.close()

    return extract_constant(code, symbol, default)
490872
def compile(self):
        
        if self.disabled:
            return
        self._check_configs()
        for _, cfg in self.configs.iteritems():
            cfg.parse()
            if cfg.changes_found() or self.skip_mtime_check:
                self.log.debug("Changes found for " + cfg.path \
                        + " or checks disabled. Compiling...")
                cfg.compile(self)
1077542
def p_compilerDirective(p):
    """'"""
    directive = p[3].lower()
    param = p[5]
    if directive == 'include':
        fname = param
        if p.parser.file:
            if os.path.dirname(p.parser.file):
                fname = os.path.join(os.path.dirname(p.parser.file),
                                     fname)
        p.parser.mofcomp.compile_file(fname, p.parser.handle.default_namespace)
    elif directive == 'namespace':
        p.parser.handle.default_namespace = param
        if param not in p.parser.qualcache:
            p.parser.qualcache[param] = NocaseDict()

    p[0] = None
148694
function compile(
  source,
  filename = '',
  includeModule = false,
  debugMode = false,
) {
  let res
  let resName
  let errors

  try {
    const [moduleName, bsCode, diagnosticErrors] = Retyped.compile(filename, source, debugMode)
    const fmtCode = format(bsCode)
    res = fmtCode
    resName = moduleName
    errors = diagnosticErrors
  } catch (e) {
    console.error(e)
    throw new Error(`${e[0][0]}`)
  }

  if (res.includes('SYNTAX ERROR>')) {
    throw new Error(res)
  }

  if (!includeModule) {
    return res
  } else {
    return {
      moduleName: resName,
      bsCode: res,
      diagnosticErrors: errors
    }
  }
}
67568
def _compile(self, file_pattern, folder_exclude_pattern):
        """"""

        if not isinstance(file_pattern, _wcparse.WcRegexp):
            file_pattern = self._compile_wildcard(file_pattern, self.file_pathname)

        if not isinstance(folder_exclude_pattern, _wcparse.WcRegexp):

            folder_exclude_pattern = self._compile_wildcard(folder_exclude_pattern, self.dir_pathname)

        return file_pattern, folder_exclude_pattern
1260747
def compile(self, name, migrate='', rollback='', num=None):
        """"""
        if num is None:
            num = len(self.todo)

        name = '{:03}_'.format(num + 1) + name
        filename = name + '.py'
        path = os.path.join(self.migrate_dir, filename)
        with open(path, 'w') as f:
            f.write(MIGRATE_TEMPLATE.format(migrate=migrate, rollback=rollback, name=filename))

        return name
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
603800
def get_string(self, key):
        """"""

        # Massive hack, lol
        if key.startswith("lambda."):
            key = "lambda.items.{0}".format(key[7:])
        if key.startswith("apigateway."):
            key = "apigateway.items.{0}".format(key[11:])

        # Make sure key is in all_options
        if key not in self.all_options:
            kwargs = {}
            if len(self.chain) > 1:
                kwargs['source'] = Meta(self.all_options, self.chain[-2]).source
            raise BadOptionFormat("Can't find key in options", key=key, chain=self.chain, **kwargs)

        return super(MergedOptionStringFormatter, self).get_string(key)
1124242
def compile(self):
        """"""
        cs = ""
        for term in self.terms:
            if cs:
                cs += " "
            cs += term
        self.compiled_str = urllib.parse.quote(cs)
        return self
500911
def check_py(self, version, name, original, loc, tokens):
        """"""
        internal_assert(len(tokens) == 1, "invalid " + name + " tokens", tokens)
        if self.target_info < get_target_info(version):
            raise self.make_err(CoconutTargetError, "found Python " + ".".join(version) + " " + name, original, loc, target=version)
        else:
            return tokens[0]
1006025
def needs_compile(self):
        ''''''
        try:
            source_mtime = os.stat(self.sourcepath).st_mtime
        except OSError:  # no source for this template, so just return
            return False
        try:
            target_mtime = os.stat(self.targetpath).st_mtime
        except OSError: # target doesn't exist, so compile
            return True
        # both source and target exist, so compile if source newer
        return source_mtime > target_mtime
618408
def get_module_docstring(filepath):
    ""
    co = compile(open(filepath).read(), filepath, 'exec')
    if co.co_consts and isinstance(co.co_consts[0], six.string_types):
        docstring = co.co_consts[0]
    else:
        docstring = None
    return docstring