Naive implementation, to be overridden if needed
342526
protected List<ComponentDto> doKeepAuthorizedComponents(String permission, Collection<ComponentDto> components) {
    boolean allowPublicComponent = PUBLIC_PERMISSIONS.contains(permission);
    return components.stream()
      .filter(c -> (allowPublicComponent && !c.isPrivate()) || hasComponentPermission(permission, c))
      .collect(MoreCollectors.toList());
  }
456197
def Compile(self, filter_implemention):
    """"""
    return self.operator_method(self.attribute_obj, filter_implemention,
                                *self.args)
375691
protected void init() {
        for (int i = 0; i < config.getFilter().getInclusions().size(); i++) {
            inclusions.add(Pattern.compile(config.getFilter().getInclusions().get(i)).asPredicate());
        }
        for (int i = 0; i < config.getFilter().getExclusions().size(); i++) {
            exclusions.add(Pattern.compile(config.getFilter().getExclusions().get(i)).asPredicate());
        }
    }
1162965
function Property(path, node, scope, getObjectRef, file) {
  if (!node.method && node.kind === "init") return;
  if (!t.isFunction(node.value)) return;

  var replaceSupers = new _helpersReplaceSupers2["default"]({
    getObjectRef: getObjectRef,
    methodNode: node,
    methodPath: path,
    isStatic: true,
    scope: scope,
    file: file
  });

  replaceSupers.replace();
}
95034
function () {
    var pattern = /\{(\d+)\}/g;
    //safer way to convert a pseudo array to an object array
    var args = Array.prototype.slice.call(arguments);
    var s = args.shift();
    return s.replace(pattern, function(c, d) {
      var replacement = args[d] ;
      if (lib.isNull(replacement)) {
        replacement = "";
      }
      return replacement;
    });
  }
596919
private function initType()
    {
        if ($this->getCallable() instanceof \Closure) {
            $this->setType(self::CLOSURE_TYPE);

        } else {
            $callable = $this->explodeCallable();
            if (count($callable) === 1) {
                if (is_object($callable[0])) {
                    $this->setType(self::INVOKED_OBJECT_TYPE);

                } else {
                    $this->setType(self::FUNCTION_TYPE);
                }

            } elseif (count($callable) === 2) {
                if (is_object($callable[0])) {
                    $this->setType(self::INSTANCE_METHOD_TYPE);

                } else {
                    $this->setType(self::STATIC_METHOD_TYPE);
                }

            } else {
                $this->setType(self::ERROR_TYPE);
                throw new \LogicException('Type not found for callable');
            }
        }
    }
139869
def append(self, value):
        

        # We inline this checks to prevent method invocation each time
        if self.children is None:
            self._parse_children()

        self.children.append(self._make_value(value))

        if self._native is not None:
            self._native.append(self.children[-1].native)

        self._mutated = True
961457
private boolean overridingMethodFound(ExecutableElement method) {
        TypeElement containingClass = utils.getEnclosingTypeElement(method);
        for (ExecutableElement listmethod : methlist) {
            if (containingClass == utils.getEnclosingTypeElement(listmethod)) {
                // it's the same method.
                return true;
            }
            TypeElement te = utils.overriddenClass(listmethod);
            if (te == null) {
                continue;
            }
            if (te == containingClass || utils.isSubclassOf(te, containingClass)) {
                return true;
            }
        }
        return false;
    }
42454
function overwrite(input, clone) {
  // Overwrite input.getReader, input.locked, etc to point to clone
  Object.entries(Object.getOwnPropertyDescriptors(ReadableStream.prototype)).forEach(([name, descriptor]) => {
    if (name === 'constructor') {
      return;
    }
    if (descriptor.value) {
      descriptor.value = descriptor.value.bind(clone);
    } else {
      descriptor.get = descriptor.get.bind(clone);
    }
    Object.defineProperty(input, name, descriptor);
  });
}
798036
function(key, data) {
        var currentData;
        currentData = settings[key];
        if ((currentData != null) && _.isObject(currentData)) {
          settings[key] = _.extend(data, settings[key]);
        } else if (currentData == null) {
          settings[key] = data;
        }
      }
520355
private static void applyOverrides() {
        // Get the appropriate InputStream to read overrides from, if any.
        InputStream stream = getContentTypesPropertiesStream();
        if (stream == null) {
            return;
        }

        try {
            try {
                // Read the properties file...
                Properties overrides = new Properties();
                overrides.load(stream);
                // And translate its mapping to ours...
                for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    String extension = (String) entry.getKey();
                    String mimeType = (String) entry.getValue();
                    add(mimeType, extension);
                }
            } finally {
                stream.close();
            }
        } catch (IOException ignored) {
        }
    }
376733
function extend(from, to, path, overrideLoc) {
  for (var prop in from) {
    if (!(prop in to) || (prop == "loc" && overrideLoc)) {
      to[prop] = from[prop]
    } else if (prop == "properties" || prop == "staticProperties") {
      extend(from[prop], to[prop], path.concat(prop))
    } else {
      var msg = "Conflicting information for " + path.join(".") + "." + prop
      if (to.loc) msg += " at " + to.loc.file + ":" + to.loc.line
      if (from.loc) msg += (to.loc ? " and " : " at ") + from.loc.file + ":" + from.loc.line
      throw new SyntaxError(msg)
    }
  }
  return to
}
181801
def method(self, symbol):
        '''
        
        '''
        assert issubclass(symbol, SymbolBase)
        def wrapped(fn):
            setattr(symbol, fn.__name__, fn)
        return wrapped
635122
def overrideable_partial(func, *args, **default_kwargs):
    
    import functools
    @functools.wraps(func)
    def partial_wrapper(*given_args, **given_kwargs):
        kwargs = default_kwargs.copy()
        kwargs.update(given_kwargs)
        return func(*(args + given_args), **kwargs)
    return partial_wrapper
922031
private <T extends Property> Map<String, String> getOverriddenImplementationConfiguration(
            Collection<T> overridableProperties) {

        Map<String, String> ret = new HashMap<>();

        overridableProperties.forEach(p -> {
            String val = getProperty(p, null);
            if (val != null) {
                ret.put(p.getPropertyName(), val);
            }
        });

        implementationConfiguration.forEach(ret::putIfAbsent);

        return ret;
    }
1137144
def mutating_method(func):
    """"""
    def wrapper(self, *__args, **__kwargs):
        old_mutable = self._mutable
        self._mutable = True
        try:
            # Call the wrapped function
            return func(self, *__args, **__kwargs)
        finally:
            self._mutable = old_mutable
    return wrapper
831333
function (defaults, configure) {
        for (var key in defaults) {
            if (defaults.hasOwnProperty(key)) {
                if (typeof defaults[key] === 'object') {
                    // recursive
                    if (typeof configure[key] === 'object') {
                        overwriteConfig(defaults[key], configure[key]);
                    }
                } else {
                    // copy directly
                    if (typeof configure[key] !== 'undefined') {
                        defaults[key] = configure[key];
                    }
                }
            }
        }
    }