Build the wily cache.
321273
def build(ctx, max_revisions, targets, operators, archiver):
    """"""
    config = ctx.obj["CONFIG"]

    from wily.commands.build import build

    if max_revisions:
        logger.debug(f"Fixing revisions to {max_revisions}")
        config.max_revisions = max_revisions

    if operators:
        logger.debug(f"Fixing operators to {operators}")
        config.operators = operators.strip().split(",")

    if archiver:
        logger.debug(f"Fixing archiver to {archiver}")
        config.archiver = archiver

    if targets:
        logger.debug(f"Fixing targets to {targets}")
        config.targets = targets

    build(
        config=config,
        archiver=resolve_archiver(config.archiver),
        operators=resolve_operators(config.operators),
    )
    logger.info(
        "Completed building wily history, run `wily report <file>` or `wily index` to see more."
    )
773685
def build(templates=None, schemes=None, base_output_dir=None):
    """"""
    template_dirs = templates or get_template_dirs()
    scheme_files = get_scheme_files(schemes)
    base_output_dir = base_output_dir or rel_to_cwd('output')

    # raise LookupError if there is not at least one template or scheme
    # to work with
    if not template_dirs or not scheme_files:
        raise LookupError

    # raise PermissionError if user has no write acces for $base_output_dir
    try:
        os.makedirs(base_output_dir)
    except FileExistsError:
        pass

    if not os.access(base_output_dir, os.W_OK):
        raise PermissionError

    templates = [TemplateGroup(path) for path in template_dirs]

    build_from_job_list(scheme_files, templates, base_output_dir)
    print('Finished building process.')
935908
public function build()
    {
        $files = $this->filesystem->listFiles($this->directory);

        $this->cache->clear();

        foreach ($files as $file) {
            if ($file['extension'] == 'yml' || $file['extension'] == 'yaml') {
                $this->cache->put($file['filename'], $this->yaml->parse($this->filesystem->read($file['path'])));
            }
        }

        $this->cache->persist();
        $this->updateValues();
    }
417132
def build(self):
        """"""
        if self.is_built():  # pragma: no cover
            return
        with _wait_signal(self.loadFinished, 20):
            self.rebuild()
        self._built = True
1256645
def write_cache(self):
        """"""
        doc = {
            '__format__': 1,
            'dependencies': self._cache,
        }
        with open(self._cache_file, 'w') as f:
            json.dump(doc, f, sort_keys=True)
980028
def cache(key, options = {}, &block) # :doc:
        if cache_configured?
          cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
        else
          yield
        end
      end
196974
def _fill_cache(self, namespace):
        """"""

        modules = self._findPluginModules(namespace)

        self._cache = list(modules)
939457
def update_cache(self, data):
        """"""
        UTILS.update(self._cache, data)
        self._save_cache()
935881
private function buildObjects(): void
    {
        //deep dependency level, start to array end for not use array_reverse
        for ($i = \count($this->tree) - 1; $i >= 0; $i--) {

            //class
            foreach ($this->tree[$i] as $class => $arguments) {

                //try to find object in class
                $object = $this->cache[$class] ?? null;

                //if object is not in cache and need arguments try to build
                if ($object === null && \count($arguments)) {

                    //build arguments
                    $args = $this->buildArguments($class, $arguments);

                    //store object with dependencies in cache
                    $this->cache[$class] = (new ReflectionClass($class))->newInstanceArgs($args);

                    continue;
                }

                if ($object === null) {

                    //store object in cache
                    $this->cache[$class] = (new ReflectionClass($class))->newInstance();
                }
            }
        }
    }
717142
def build_frame(cache, keys)
      line, type = keys
      abs_path, lineno, function, _module_name = parse_line(line)

      frame = Stacktrace::Frame.new
      frame.abs_path = abs_path
      frame.filename = strip_load_path(abs_path)
      frame.function = function
      frame.lineno = lineno.to_i
      frame.library_frame = library_frame?(config, abs_path)

      line_count =
        context_lines_for(config, type, library_frame: frame.library_frame)
      frame.build_context line_count

      cache[[line, type]] = frame
    end
734066
function buildMap() {
    var dependencies = self.build.dependencies = {};
    var cacheTime = self.cache.stats;
    var buildTime = self.build.mtime;

    Object.keys(cacheTime).forEach(function (filepath) {
      buildTime[filepath] = cacheTime[filepath].getTime();
    });

    // deep resolve all dependencies
    self.build.dirMap.forEach(function (filename) {
      var list = [];

      // the result array will be filled by his function
      deepResolve(self, filename, list);

      // dry result array
      var result = dependencies[filename] = [];
      var i = list.length;
      while(i--) {
        if (result.indexOf(list[i]) === -1) {
          result.push(list[i]);
        }
      }
    });
  }
1163069
def cache_generator(self, key, generator):
        """"""
        results = []
        for result in generator:
            results.append(result)
            yield result

        self.inferred[key] = tuple(results)
1208323
public static function build()
    {
        switch (true) {
            // @codeCoverageIgnoreStart
            case extension_loaded('apc'):
                $cacheDriver = new ApcuCache;
                break;

            case extension_loaded('xcache'):
                $cacheDriver = new XcacheCache;
                break;

            case extension_loaded('memcache'):
                $memcache = new \Memcache;
                $memcache->connect('127.0.0.1');

                $cacheDriver = new MemcacheCache;
                $cacheDriver->setMemcache($memcache);
                break;

            case extension_loaded('redis'):
                $redis = new \Redis();
                $redis->connect('127.0.0.1');

                $cacheDriver = new RedisCache;
                $cacheDriver->setRedis($redis);
                break;
            // @codeCoverageIgnoreEnd

            default:
                $cacheDriver = new ArrayCache;
        }

        return $cacheDriver;
    }
269558
def build(self, db=None, safe_mode=False, for_each_inst=None, extra=None):
        """"""
        result = copy(self.initial)
        result.update(self.static)
        if self.dynamic:
            result.update(self.build_dynamic(db, extra=extra, safe_mode=safe_mode))
        if self.for_each and for_each_inst:
            result.update(self.build_for_each(db, safe_mode=safe_mode, extra=extra))
        if isinstance(extra, dict):
            result.update(extra)
        return result
729730
protected static function BuildCache() {
      self::CalculateData(self::$Categories);
      self::JoinRecentPosts(self::$Categories);
      Gdn::Cache()->Store(self::CACHE_KEY, self::$Categories, array(Gdn_Cache::FEATURE_EXPIRY => 600));
   }
28695
def build(self):
        """"""
        from ambry.orm.config import BuildConfigGroupAccessor

        # It is a lightweight object, so no need to cache
        return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)
674666
def load_internal_cache(cls, pex, pex_info):
    """"""
    internal_cache = os.path.join(pex, pex_info.internal_cache)
    with TRACER.timed('Searching dependency cache: %s' % internal_cache, V=2):
      if os.path.isdir(pex):
        for dist in find_distributions(internal_cache):
          yield dist
      else:
        for dist in itertools.chain(*cls.write_zipped_internal_cache(pex, pex_info)):
          yield dist