Returns a list of {@code uses} directives in {@code directives}.
@return a list of {@code uses} directives in {@code directives}
@param directives the directives to filter
@since 9
@spec JPMS
546793
public static List<UsesDirective>
            usesIn(Iterable<? extends Directive> directives) {
        return listFilter(directives, DirectiveKind.USES, UsesDirective.class);
    }
732736
public static ConsoleParser[] filterExisting(final Collection<? extends ConsoleParser> parsers) {
        List<ConsoleParser> existing = Lists.newArrayList();
        for (ConsoleParser parser : parsers) {
            if (ParserRegistry.exists(parser.getParserName())) {
                existing.add(parser);
            }
        }
        return existing.toArray(new ConsoleParser[existing.size()]);
    }
1152474
public ArrayList<PathImpl> getPaths(ArrayList<PathImpl> paths)
  {
    PathListCallback cb = new PathListCallback(paths);

    filterPaths(cb);
    
    Collections.sort(paths);

    return paths;
  }
106702
@RequestMapping(value = "/scope", method = GET, produces = APPLICATION_JSON_VALUE)
	public List<Scope> allScopes() {
		return this.scopeService.getAllScopes();
	}
543559
public static List<Node> removeNestedChangeScopeNodes(List<Node> scopeNodes) {
    Set<Node> uniqueScopeNodes = new LinkedHashSet<>(scopeNodes);
    for (Node scopeNode : scopeNodes) {
      for (Node ancestor = scopeNode.getParent();
          ancestor != null;
          ancestor = ancestor.getParent()) {
        if (isChangeScopeRoot(ancestor) && uniqueScopeNodes.contains(ancestor)) {
          uniqueScopeNodes.remove(scopeNode);
          break;
        }
      }
    }
    return new ArrayList<>(uniqueScopeNodes);
  }
128513
private List<Artifact> getScopeArtifacts( final MavenProject project, final String scope )
    {
        if ( SCOPE_COMPILE.equals( scope ) )
        {
            return project.getCompileArtifacts();
        }
        if ( SCOPE_RUNTIME.equals( scope ) )
        {
            return project.getRuntimeArtifacts();
        }
        else if ( SCOPE_TEST.equals( scope ) )
        {
            return project.getTestArtifacts();
        }
        else
        {
            throw new RuntimeException( "Not allowed scope " + scope );
        }
    }
1349124
public @Nonnull List<String> getJobs() {
        List<String> r = new ArrayList<>();
        r.addAll(usages.keySet());
        Collections.sort(r);
        return r;
    }
772328
@java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.Long> getUsedBytesOnTiers() {
    return getUsedBytesOnTiersMap();
  }
962807
public java.util.List<String> getFileShareARNList() {
        if (fileShareARNList == null) {
            fileShareARNList = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return fileShareARNList;
    }
1293136
public static ServerCacheControl parse(Iterable<String> directives) {
        requireNonNull(directives, "directives");
        final ServerCacheControlBuilder builder = new ServerCacheControlBuilder();
        for (String d : directives) {
            parseCacheControl(d, (name, value) -> {
                final BiConsumer<ServerCacheControlBuilder, String> action = DIRECTIVES.get(name);
                if (action != null) {
                    action.accept(builder, value);
                }
            });
        }

        return builder.build();
    }
547032
public java.util.List<SubscriptionFilter> getSubscriptionFilters() {
        if (subscriptionFilters == null) {
            subscriptionFilters = new com.amazonaws.internal.SdkInternalList<SubscriptionFilter>();
        }
        return subscriptionFilters;
    }
531776
public List<Dependency> getDependencies(List<String> scopes) {
        log.debug( "Valid scopes: {}", scopes );
        List<Dependency> dependencies = new ArrayList<Dependency>();

        for (Dependency dependency : getMavenModel().getDependencies()) {

            // Substitute Properties
            // XXX: There has to be a way maven handles this automatically
            log.debug( "Project properties: {} ", this.mavenModel.getProperties() );
            String artifactId = substituteProperty(dependency.getArtifactId());
            String groupId    = substituteProperty(dependency.getGroupId());
            String version    = substituteProperty(dependency.getVersion());
            String type       = substituteProperty(dependency.getType());
            String classifier = substituteProperty(dependency.getClassifier());
            String systemPath = substituteProperty(dependency.getSystemPath());

            dependency.setSystemPath(systemPath);
            dependency.setArtifactId(artifactId);
            dependency.setGroupId(groupId);
            dependency.setVersion(version);
            dependency.setType(type);
            dependency.setClassifier( classifier );

            dependencies.add(dependency);
        }


        if ( scopes == null ) {
            scopes = Arrays.asList( "compile", "runtime" );
        }

        for ( Iterator<Dependency> iterator = dependencies.iterator(); iterator.hasNext(); ) {
            Dependency dependency = iterator.next();

            String scope = dependency.getScope();

            // Default scope for dependencies is compile
            if ( scope == null ) {
                scope = "compile";
            }

            if ( !scopes.contains( scope ) ) {
                log.debug( "Removing {} with scope {}", dependency, dependency.getScope() );
                iterator.remove();
            }
        }

        return dependencies;
    }
877118
public Operations getOperationsForScope(OperationScope... scopes) {
        final Operations result = new Operations();
        final List<Operation> r = new ArrayList<Operation>();
        if (getOperations() != null) {
            for (Operation op : getOperations()) {
                if (op.getScope() != null) {
                    String s = op.getScope().trim();
                    for (int i = 0; i < scopes.length; i++) {
                        OperationScope scope = scopes[i];
                        if (scope.is(s)) {
                            r.add(op);
                            break;
                        }
                    }
                }
            }
            result.setOperations(r);
        }
        return result;
    }
987752
def extract_directives(header)
        processed_header = String.new("")
        directives = []

        header.lines.each_with_index do |line, index|
          if directive = line[DIRECTIVE_PATTERN, 1]
            name, *args = Shellwords.shellwords(directive)
            if respond_to?("process_#{name}_directive", true)
              directives << [index + 1, name, *args]
              # Replace directive line with a clean break
              line = "\n"
            end
          end
          processed_header << line
        end

        processed_header.chomp!
        # Ensure header ends in a new line like before it was processed
        processed_header << "\n" if processed_header.length > 0 && header[-1] == "\n"

        return processed_header, directives
      end
358532
public function getDirectives()
    {
        if ($this->directives === null) {
            $this->directives = array();
            foreach ($this->parseParams() as $collection) {
                foreach ($collection as $key => $value) {
                    $this->directives[$key] = $value === '' ? true : $value;
                }
            }
        }

        return $this->directives;
    }
1332509
public static List<ExportsDirective>
            exportsIn(Iterable<? extends Directive> directives) {
        return listFilter(directives, DirectiveKind.EXPORTS, ExportsDirective.class);
    }
777261
def directives():
    '''
    
    '''
    cmd = '{0} -L'.format(_detect_os())
    ret = {}
    out = __salt__['cmd.run'](cmd)
    out = out.replace('\n\t', '\t')
    for line in out.splitlines():
        if not line:
            continue
        comps = line.split('\t')
        desc = '\n'.join(comps[1:])
        ret[comps[0]] = desc
    return ret