Get the dependencies for an action.

@param a the action to check
@return its dependencies, may be empty
505215
public Set<Action> getDependencies(Action a) {
        if (!demandingNodes.containsKey(a)) {
            return Collections.emptySet();
        }
        Node n = demandingNodes.get(a);
        Set<Action> allActions = getFreeings(n);
        Set<Action> pre = new HashSet<>();
        for (Action action : allActions) {
            if (!action.equals(a) && a.getStart() >= action.getEnd()) {
                pre.add(action);
            }
        }
        return pre;
    }
961268
public List<Action> getRootActions() {
		final List<Action> rootActions = srcUpdTrees.stream().map(t -> originalActionsSrc.get(t))
				.collect(Collectors.toList());

		rootActions.addAll(srcDelTrees.stream() //
				.filter(t -> !srcDelTrees.contains(t.getParent()) && !srcUpdTrees.contains(t.getParent())) //
				.map(t -> originalActionsSrc.get(t)) //
				.collect(Collectors.toList()));

		rootActions.addAll(dstAddTrees.stream() //
				.filter(t -> !dstAddTrees.contains(t.getParent()) && !dstUpdTrees.contains(t.getParent())) //
				.map(t -> originalActionsDst.get(t)) //
				.collect(Collectors.toList()));

		rootActions.addAll(dstMvTrees.stream() //
				.filter(t -> !dstMvTrees.contains(t.getParent())) //
				.map(t -> originalActionsDst.get(t)) //
				.collect(Collectors.toList()));

		rootActions.removeAll(Collections.singleton(null));
		return rootActions;
	}
544452
@Override
    public Collection<AgentProjectInfo> collectDependencies(String rootDirectory) {
        Collection<AgentProjectInfo> projects = new ArrayList<>();
        if (!this.isMavenExist(rootDirectory)) {
            logger.warn("Please install maven");
        } else {
            if (runPreStep) {
                try {
                    CommandLineProcess mvnCleanInstall = new CommandLineProcess(rootDirectory, getCleanInstallCommandParams());
                    mvnCleanInstall.executeProcess();
                    if (mvnCleanInstall.isErrorInProcess()) {
                        logger.warn("Failed to execute the command {}", getCleanInstallCommandParams());
                    }

                } catch (Exception e) {
                    logger.warn("Error while execute dependencies after running {} on {}, {}", getCleanInstallCommandParams(), rootDirectory, e.getMessage());
                    logger.debug("Error: {}", e.getStackTrace());
                }
            }

            if (StringUtils.isBlank(M2Path)) {
                this.M2Path = getMavenM2Path(Constants.DOT);
            }

            try {
                CommandLineProcess mvnDependencies = new CommandLineProcess(rootDirectory, getLsCommandParamsBatchMode());
                List<String> lines = mvnDependencies.executeProcess();

                if (mvnDependencies.isErrorInProcess()) {
                    logger.debug("Failed to execute the command {}", getLsCommandParamsBatchMode());
                    mvnDependencies = new CommandLineProcess(rootDirectory, getLsCommandParams());
                    lines = mvnDependencies.executeProcess();
                }
                // set flag of errors, in case we do not have errors  we do not want to parse direct dependencies from pom later on.
                if (mvnDependencies.isErrorInProcess()) {
                    this.errorsRunningDependencyTree = true;
                }
                if (!mvnDependencies.isErrorInProcess() || mavenIgnoreDependencyTreeErrors) {
                    List<Node> nodes = mavenLinesParser.parseLines(lines);

                    logger.info("End parsing pom files , found : " + String.join(Constants.COMMA,
                            nodes.stream().map(node -> node.getArtifactId()).collect(Collectors.toList())));

                    projects = nodes.stream()
                            .filter(node -> !this.ignorePomModules || (ignorePomModules && !node.getPackaging().equals(Constants.POM)))
                            .map(tree -> {
                                Map<String, List<DependencyInfo>> pathToDependenciesMap = new HashMap<>();
                                List<DependencyInfo> dependencies = new LinkedList<>();
                                Stream<Node> nodeStream = tree.getChildNodes().stream().filter(node -> !mavenIgnoredScopes.contains(node.getScope()));
                                dependencies.addAll(nodeStream.map(node -> getDependencyFromNode(node, pathToDependenciesMap)).collect(Collectors.toList()));
                                Map<String, String> pathToSha1Map = pathToDependenciesMap.keySet().stream().distinct().parallel().collect(Collectors.toMap(file -> file, file -> getSha1(file)));
                                pathToSha1Map.entrySet().forEach(pathSha1Pair -> pathToDependenciesMap.get(pathSha1Pair.getKey()).stream().forEach(dependency -> {
                                    dependency.setSha1(pathSha1Pair.getValue());
                                    dependency.setSystemPath(pathSha1Pair.getKey());
                                }));
                                AgentProjectInfo projectInfo = new AgentProjectInfo();
                                projectInfo.setCoordinates(new Coordinates(tree.getGroupId(), tree.getArtifactId(), tree.getVersion()));
                                logger.debug("Project/Module coordinates: {}", projectInfo.getCoordinates().toString());
                                logger.debug("Total project direct dependencies found : {}", dependencies.size());
                                dependencies.stream().filter(dependency -> StringUtils.isNotEmpty(dependency.getSha1()) ||
                                        (StringUtils.isNotEmpty(dependency.getGroupId()) && StringUtils.isNotEmpty(dependency.getArtifactId())
                                                && StringUtils.isNotEmpty(dependency.getVersion()))).forEach(dependency ->
                                        projectInfo.getDependencies().add(dependency));
                                logger.debug("ProjectInfo direct dependency added : {}", projectInfo.getDependencies().size());
                                return projectInfo;
                            }).collect(Collectors.toList());
                } else {
                    logger.warn("Failed to scan and send {}", getLsCommandParams()); //either dead code? supposed to be up there..
                }
            } catch (IOException e) {
                logger.warn("Error getting dependencies after running {} on {}, {}", getLsCommandParams(), rootDirectory, e.getMessage());
                logger.debug("Error: {}", e.getStackTrace());
            }

            if (projects != null && projects.isEmpty()) {
                if (!showMavenTreeError) {
                    logger.warn("Failed to getting dependencies after running '{}'", getLsCommandParams());
                    showMavenTreeError = true;
                }
            }
        }
        return projects;
    }
982916
def get_dependencies(self, filename):
        
        if self.is_partial(filename):
            return self.templates
        elif self.is_template(filename):
            return [self.get_template(filename)]
        elif self.is_static(filename):
            return [filename]
        else:
            return []
87594
protected MavenArtifactInfo[] parseDependencies(final List<DependencyNode> children) {
        final MavenArtifactInfo[] dependecies = new MavenArtifactInfo[children.size()];
        int i = 0;
        for (final DependencyNode child : children) {
            dependecies[i++] = MavenArtifactInfoImpl.fromDependencyNode(child);
        }
        return dependecies;
    }
1112657
private List<String> getDependenciesTree(String directory, String directoryName) {
        List<String> lines;
        if (dependencyTrees.get(directoryName) == null) {
            String[] gradleCommandParams = gradleCli.getGradleCommandParams(GradleMvnCommand.DEPENDENCIES);
            lines = gradleCli.runGradleCmd(directory, gradleCommandParams, true);
            dependencyTrees.put(directoryName, lines);
        } else {
            lines = dependencyTrees.get(directoryName);
        }
        return lines;
    }
642328
def dependencies( scopes = nil)
      if scopes
        unless scopes.is_a? Array
           scopes = [scopes]
        end
      end
          
      if Naether.platform == 'java'
        if scopes.nil?
          deps = @project.getDependenciesNotation()
        else
          deps = @project.getDependenciesNotation( scopes )
        end
        
      elsif scopes
        list = Naether::Java.convert_to_java_list( scopes )

        deps = @project._invoke('getDependenciesNotation', 'Ljava.util.List;', list)
      else
        deps = @project.getDependenciesNotation()
      end

      
      Naether::Java.convert_to_ruby_array( deps, true )
    end
1222485
public function getDependencies()
    {
        $dependencies = [];
        if ($this->extendsClassDefinition && $this->extendsClassDefinition instanceof self) {
            $dependencies[] = $this->extendsClassDefinition;
        }

        foreach ($this->implementedInterfaceDefinitions as $interfaceDefinition) {
            if ($interfaceDefinition instanceof self) {
                $dependencies[] = $interfaceDefinition;
            }
        }

        return $dependencies;
    }
888011
void get_possible_actions(State source,
                              List<Action> actions)
    {
        if (0 == L || -1 == R)
        {
            System.err.println("decoder: not initialized, please check if the root dependency relation is correct set by --root.");
            return;
        }
        actions.clear();

        if (!source.buffer_empty())
        {
            actions.add(ActionFactory.make_shift());
        }

        if (source.stack_size() == 2)
        {
            if (source.buffer_empty())
            {
                actions.add(ActionFactory.make_right_arc(R));
            }
        }
        else if (source.stack_size() > 2)
        {
            for (int l = 0; l < L; ++l)
            {
                if (l == R)
                {
                    continue;
                }
                actions.add(ActionFactory.make_left_arc(l));
                actions.add(ActionFactory.make_right_arc(l));
            }
        }
    }
1340760
public static EvernoteInstallStatus getEvernoteInstallStatus(Context context, String action) {
        PackageManager packageManager = context.getPackageManager();
        Intent intent = new Intent(action).setPackage(PACKAGE_NAME);

        List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (!resolveInfos.isEmpty()) {
            return validateSignature(packageManager);
        }

        try {
            // authentication feature not available, yet
            packageManager.getPackageInfo(PACKAGE_NAME, PackageManager.GET_ACTIVITIES);
            return EvernoteInstallStatus.OLD_VERSION;

        } catch (Exception e) {
            return EvernoteInstallStatus.NOT_INSTALLED;
        }
    }
148866
protected Collection<Artifact> getAllDependencies() throws Exception {
        List<Artifact> artifacts = new ArrayList<Artifact>();

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

            String groupId = dependency.getGroupId();
            String artifactId = dependency.getArtifactId();

            VersionRange versionRange;
            try {
                versionRange = VersionRange.createFromVersionSpec(dependency.getVersion());
            } catch (InvalidVersionSpecificationException e) {
                throw new MojoExecutionException("unable to parse version", e);
            }

            String type = dependency.getType();
            if (type == null) {
                type = "jar";
            }
            String classifier = dependency.getClassifier();
            boolean optional = dependency.isOptional();
            String scope = dependency.getScope();
            if (scope == null) {
                scope = Artifact.SCOPE_COMPILE;
            }

            Artifact art = this.artifactFactory.createDependencyArtifact(groupId, artifactId, versionRange,
                    type, classifier, scope, null, optional);

            if (scope.equalsIgnoreCase(Artifact.SCOPE_SYSTEM)) {
                art.setFile(new File(dependency.getSystemPath()));
            }

            List<String> exclusions = new ArrayList<String>();
            for (Iterator<?> j = dependency.getExclusions().iterator(); j.hasNext();) {
                Exclusion e = (Exclusion)j.next();
                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
            }

            ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);

            art.setDependencyFilter(newFilter);

            artifacts.add(art);
        }

        return artifacts;
    }
927439
public java.util.List<ResourcePendingMaintenanceActions> getPendingMaintenanceActions() {
        if (pendingMaintenanceActions == null) {
            pendingMaintenanceActions = new com.amazonaws.internal.SdkInternalList<ResourcePendingMaintenanceActions>();
        }
        return pendingMaintenanceActions;
    }
971699
public DuzztState getSuccessor(DuzztAction action) {
		DuzztTransition t = getTransition(action);
		if(t == null) {
			return null;
		}
		return t.getSuccessor();
	}
233500
def add_dependencies(step, action)
      action.required_step_ids.each do |required_step_id|
        @graph[step.id] << required_step_id
      end
    end
191603
@Override
    public Collection<AgentProjectInfo> collectDependencies(String rootDirectory) {
        this.rootDirectory = rootDirectory;
        Collection<DependencyInfo> dependencies = new LinkedList<>();
        // check if paket group is not ignored & it has dependencies
        if (paketIgnoredGroups == null || !Arrays.asList(paketIgnoredGroups).contains(getGroupName().toLowerCase())) {
            if (!this.directDependenciesNames.isEmpty()) {
                List<String> groupLines = getGroupDependenciesFromPaketLock();
                for (String dependencyName : this.directDependenciesNames) {
                    DependencyInfo dependency = new DependencyInfo();
                    dependency.setGroupId(dependencyName);
                    dependency.setChildren(collectChildrenDependencies(dependency, groupLines));
                    if(dependency.getSha1() == null && dependency.getArtifactId() == null) {
                        logger.warn(DEPENDECYERROR, dependency.getGroupId());
                    } else {
                        dependencies.add(dependency);
                    }
                }
            }
        }
        return getSingleProjectList(dependencies);
    }
683939
protected String[] getActions()
    {
        ActionConfig[] actionConfigs = getModuleConfig().findActionConfigs();
        ArrayList actionNames = new ArrayList();

        for ( int i = 0; i < actionConfigs.length; i++ )
        {
            ActionConfig ac = actionConfigs[i];
            actionNames.add( ac.getPath().substring( 1 ) ); // every action path has a '/' in front of it
        }

        return ( String[] ) actionNames.toArray( new String[0] );
    }
811997
public static Parameter getActionParameter(Action action, String paramName) {
        for (Parameter param : action.getParameters()) {
            if (paramName.equals(param.getName())) {
                return param;
            }
        }
        return NOT_FOUND_PARAMETER;
    }