Get list of filter methods to be applied to a specific action.
178002
function getFilterMethods(type, controller, action) {
  // Get all filters for the action.
  let filters = getFilters(type, controller, action)
  // Get filter method names to be skipped.
  type = `skip${type[0].toUpperCase() + type.slice(1)}`
  let skipFilterMethods = _.map(getFilters(type, controller, action), 'action')

  // Remove filters that should be skipped.
  filters = _.filter(filters, f => {
    for(let method of skipFilterMethods)
      if(method === f.action)
        return false
    return true
  })

  // Return final list of filter methods.
  return _.map(filters, f => {
    let { action } = f
    action = typeof action === 'string' ? controller[action] : action
    return action.bind(controller)
  })
}
1340644
def list_actions(cls):
        """"""
        # Make sure these are always at the beginning of the list
        actions = ['start', 'stop', 'restart', 'status']
        # Iterate over the instance attributes checking for actions that
        # have been exposed
        for func_name in dir(cls):
            func = getattr(cls, func_name)
            if (not hasattr(func, '__call__') or
                    not getattr(func, '__daemonocle_exposed__', False)):
                # Not a function or not exposed
                continue
            action = func_name.replace('_', '-')
            if action not in actions:
                actions.append(action)

        return actions
851039
def filter_queryset(self, request, queryset, view):
        
        # Check if this is a list type request
        if view.lookup_field not in view.kwargs:
            if not self.action_routing:
                return self.filter_list_queryset(request, queryset, view)
            else:
                method_name = "filter_{action}_queryset".format(action=view.action)
                return getattr(self, method_name)(request, queryset, view)
        return queryset
788388
public FunctionList webMethodsLegacy() {
        return filter(new Filter() {
            public boolean keep(Function m) {
                return m.getName().startsWith("do") || m.getAnnotation(WebMethod.class)!=null;
            }
        });
    }
107927
private function applyFilters()
    {
        $availableOptions = ['name', 'method', 'uri', 'action', 'middleware'];
        foreach ($this->options() as $key => $option) {
            if (in_array($key, $availableOptions) && null != $option) {
                foreach ($this->routes as $index => $route) {
                    if (!str_contains(strtolower($route[$key]), strtolower($option)))
                        unset($this->routes[$index]);
                }
            }
        }
    }
1194218
function filterByMethods(req) {
        if(_config.allowedMethods) {
            return _config.allowedMethods.indexOf(req.method) > -1;
        } else if(_config.blockedMethods){
            return !(_config.blockedMethods.indexOf(req.method) > -1);
        } else {
            return true;
        }
    }
677718
def filters(self):
        
        params = {}
        for _filter in self._filters:
            params.update(_filter)

        return params
1158632
public List<FilterDefinition> getFilters() {
		try {
			if (isStarted()) {
				final FilterAcknowledger acknowledger = new FilterAcknowledger();
				
				// Be sure that the emit/ack is synchronous to get the filters before the test are run
				new Thread(new Runnable() {
					@Override
					public void run() {
						try {
							LOGGER.finest("Retrieve filters");
							socket.emit("filters:get", acknowledger);
						}
						catch (Exception e) {
							LOGGER.finest("Unable to get the filters: " + e.getMessage());
							synchronized (acknowledger) {
								acknowledger.notify();
							}
						}
					}
				}).start();

				synchronized (acknowledger) {
					acknowledger.wait();
				}

				if (!acknowledger.hasFilters()) {
					for (FilterDefinition filter : acknowledger.getFilters()) {
						LOGGER.info("Filter element: " + filter);
					}
				}

				return acknowledger.getFilters();
			}
		}
		catch (Exception e) {
			LOGGER.warning("Unable to retrieve the filters from the agent. Cause: " + e.getMessage());
			e.printStackTrace();
			if (LOGGER.getLevel() == Level.FINEST) {
				LOGGER.log(Level.FINEST, "Exception: ", e);
			}
		}
		
		return null;
	}
334981
public List<Method> getMethodsFromGroupIds(int[] groupIds, String[] filters) throws Exception {
        ArrayList<Method> methods = new ArrayList<Method>();

        for (int groupId : groupIds) {
            methods.addAll(getMethodsFromGroupId(groupId, filters));
        }

        return methods;
    }
1179427
public static responderaction[] get_filtered(nitro_service service, String filter) throws Exception{
		responderaction obj = new responderaction();
		options option = new options();
		option.set_filter(filter);
		responderaction[] response = (responderaction[]) obj.getfiltered(service, option);
		return response;
	}
889699
public function getMethods($filter = null)
    {
        if (!isset($this->methods)) {
            $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this);
            $parentMethods = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) {
                $reflectionMethods = [];
                foreach ($instance->getMethods() as $reflectionMethod) {
                    if (!$isParent || !$reflectionMethod->isPrivate()) {
                        $reflectionMethods[$reflectionMethod->name] = $reflectionMethod;
                    }
                }
                $result += $reflectionMethods;
            });
            $methods = $directMethods + $parentMethods;

            $this->methods = $methods;
        }
        if (!isset($filter)) {
            return array_values($this->methods);
        }

        $methods = [];
        foreach ($this->methods as $method) {
            if (!($filter & $method->getModifiers())) {
                continue;
            }
            $methods[] = $method;
        }

        return $methods;
    }
666081
public static appqoeaction[] get_filtered(nitro_service service, String filter) throws Exception{
		appqoeaction obj = new appqoeaction();
		options option = new options();
		option.set_filter(filter);
		appqoeaction[] response = (appqoeaction[]) obj.getfiltered(service, option);
		return response;
	}
710699
def Filter(self, match=None, **_):
    """"""
    arg = self.stack.pop(-1)

    # Filters can be specified as a comma separated list.
    for filter_name in match.group(1).split(","):
      filter_object = ConfigFilter.classes_by_name.get(filter_name)
      if filter_object is None:
        raise FilterError("Unknown filter function %r" % filter_name)

      if not filter_object.sensitive_arg:
        logging.debug("Applying filter %s for %s.", filter_name, arg)
      arg = filter_object().Filter(arg)
      precondition.AssertType(arg, Text)

    self.stack[-1] += arg
1115366
def get_method_map(self, viewset, method_map):
        

        bound_methods = {}

        for method, action in method_map.items():
            if hasattr(viewset, action):
                bound_methods[method] = action

        return bound_methods
907983
def clear_filters
      self.current_filter = {exclude: {actions: [], verbs: [], names: [], controllers: []},
                              include: {actions: [], verbs: [], names: [], controllers: []}}
      return nil
    end
1145839
def _apply_filters(self, p_todos):
        
        result = p_todos

        for _filter in sorted(self._filters, key=lambda f: f.order):
            result = _filter.filter(result)

        return result
945369
def get_public_methods(self):
        
        return self.get_action_methods() + [
            ('getenv', self.getenv),
            ('expandvars', self.expandvars),
            ('defined', self.defined),
            ('undefined', self.undefined)]