private boolean gatherEvidence(Dependency dependency, EvidenceType type, Pattern pattern, String contents,
            String source, String name, Confidence confidence) {
        final Matcher matcher = pattern.matcher(contents);
        final boolean found = matcher.find();
        if (found) {
            dependency.addEvidence(type, source, name, matcher.group(4), confidence);
            if (type == EvidenceType.VERSION) {
                //TODO - this seems broken as we are cycling over py files and could be grabbing versions from multiple?
                dependency.setVersion(matcher.group(4));
                final String dispName = String.format("%s:%s", dependency.getName(), dependency.getVersion());
                dependency.setDisplayFileName(dispName);
            }
        }
        return found;
    }
private boolean gatherEvidence ( Dependency dependency , EvidenceType type , Pattern pattern , String contents , String source , String name , Confidence confidence ) { final Matcher matcher = pattern . matcher ( contents ) ; final boolean found = matcher . find ( ) ; if ( found ) { dependency . addEvidence ( type , source , name , matcher . group ( 4 ) , confidence ) ; if ( type == EvidenceType . VERSION ) { dependency . setVersion ( matcher . group ( 4 ) ) ; final String dispName = String . format ( "%s:%s" , dependency . getName ( ) , dependency . getVersion ( ) ) ; dependency . setDisplayFileName ( dispName ) ; } } return found ; }
Gather evidence from a Python source file using the given string
assignment regex pattern.

@param dependency the dependency that is being analyzed
@param type the type of evidence
@param pattern to scan contents with
@param contents of Python source file
@param source for storing evidence
@param name of evidence
@param confidence in evidence
@return whether evidence was found