Decorates dynamic finder methods (`find_all_by_` and friends).
350444
def method_missing(method, *args, &block)
      return super unless method =~ /^find_(all_|last_|or_(initialize_|create_))?by_/

      result = object_class.send(method, *args, &block)
      options = args.extract_options!

      if method =~ /^find_all/
        decorate_collection(result, options)
      else
        decorate(result, options)
      end
    end
317288
function findAll(predicate) {
        var key,
            elem,
            result = [];
        for (key in _idMap) {
            if (_idMap.hasOwnProperty(key)) {
                elem = _idMap[key];
                if (predicate(elem)) {
                    result.push(elem);
                }
            }
        }
        return result;
    }
1079494
def all(cls):
        
        if not hasattr(cls, '_cache'):
            cls._cache = cls._all()
        return cls._cache
194208
def decorate(self, fun):
        """"""
        @wraps(fun)
        def _decorated(*args, **kwargs):
            # Push the config, run the function and pop it afterwards.
            self.push_config()
            try:
                return fun(*args, **kwargs)
            finally:
                self.pop_config()
        return _decorated
1299080
def group(__decorated__, **Config):
  
  """
  _Group = Group(__decorated__, Config)

  if isclass(__decorated__): # convert the method of the class to static methods so that they could be accessed like object methods; ir: g1/t1(...).
    static(__decorated__)

  state.ActiveModuleMemberQ.insert(0, _Group)

  return _Group.Underlying
954287
def find_or_build_all(cls, list_of_kwargs):
        
        return cls.add_all([cls.first(**kwargs) or cls.new(**kwargs)
                            for kwargs in list_of_kwargs], commit=False)
1004213
def push_all(collector, **kwargs):
    """"""
    configuration = collector.configuration
    configuration["harpoon"].do_push = True
    configuration["harpoon"].only_pushable = True
    make_all(collector, **kwargs)
1325013
function setAll(obj) {
    let paths = Object.keys(obj);

    paths.map(path => setSilent(path, obj[path]));
    notifyWatchersOnPaths(paths);
  }
548847
function eachObj(obj, iteratee, context) {
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      iteratee.call(context || obj, key, obj[key]);
    }
  }
}
471852
def expand(obj, relation, seen):
    

    if hasattr(relation, 'all'):
        relation = relation.all()

    if hasattr(relation, '__iter__'):
        return [expand(obj, item, seen) for item in relation]

    if type(relation) not in seen:
        return to_json(relation, seen + [type(obj)])
    else:
        return relation.id
1072481
def every(colors, output_dir=CACHE_DIR):
    """"""
    colors = flatten_colors(colors)
    template_dir = os.path.join(MODULE_DIR, "templates")
    template_dir_user = os.path.join(CONF_DIR, "templates")
    util.create_dir(template_dir_user)

    join = os.path.join  # Minor optimization.
    for file in [*os.scandir(template_dir),
                 *os.scandir(template_dir_user)]:
        if file.name != ".DS_Store" and not file.name.endswith(".swp"):
            template(colors, file.path, join(output_dir, file.name))

    logging.info("Exported all files.")
    logging.info("Exported all user files.")
704197
def recursive_include(self, dir, pattern):
        
        full_pattern = os.path.join(dir, '**', pattern)
        found = [f for f in glob(full_pattern, recursive=True)
                 if not os.path.isdir(f)]
        self.extend(found)
        return bool(found)
1122772
function findAll (tree, test) {
  var found = test(tree) ? [tree] : []
  if (isNode(tree)) {
    if (tree.children.length > 0) {
      tree.children.forEach(function (child) {
        found = found.concat(findAll(child, test))
      })
    }
  }

  return found
}
652070
def with_meta(class_to_decorate=None, add_init_kwargs=True):
    

    if class_to_decorate is None:
        return functools.partial(with_meta, add_init_kwargs=add_init_kwargs)

    if add_init_kwargs:
        def get_extra_args_function(self):
            return {k: v for k, v in self.get_meta().items() if not k.startswith('_')}

        add_args_to_init_call(class_to_decorate, get_extra_args_function)

    setattr(class_to_decorate, 'get_meta', classmethod(get_meta))

    return class_to_decorate
683935
def include(self, pattern):
        """"""
        found = [f for f in glob(pattern) if not os.path.isdir(f)]
        self.extend(found)
        return bool(found)
579837
def fetch_all(self, R, depth=1, **kwargs):
        ""
        d, e = self._fetcher.fetch_all(R, depth, kwargs)
        if e: raise e
        return d
405517
def each(iterable = None, *, name = None, metric = call_default):
    
    if iterable is None:
        return _each_decorator(name, metric)
    else:
        return _do_each(iterable, name, metric)