Scan `versioned_target`'s results directory and return the output files from that directory.

    :return: :class:`ObjectFiles`
760776
def collect_cached_objects(self, versioned_target):
    
    return ObjectFiles(versioned_target.results_dir, os.listdir(versioned_target.results_dir))
584113
def get_version(*file_paths):
    """"""
    filename = os.path.join(os.path.dirname(__file__), *file_paths)
    print("Looking for version in: {}".format(filename))
    version_file = open(filename).read()
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError('Unable to find version string.')
933612
def collect_output(self):
        
        if self.embed:
            if self.concat:
                concat_scripts = [self.compiled_scripts[path]
                                  for path in self.build_order]

                return [self.embed_template_string % '\n'.join(concat_scripts)]
            else:
                return [self.embed_template_string %
                        self.compiled_scripts[path]
                        for path in self.build_order]
        else:
            return [self.external_template_string %
                    os.path.join(
                        self.relative_directory,
                        os.path.relpath(
                            self.out_path_of(path),
                            self.output_directory))

                    for path in self.build_order
                    if self.compiled_scripts[path] != ""]
867820
def check_outputs(self):
        
        self.outputs = self.expand_filenames(self.outputs)
        result = False
        if self.files_exist(self.outputs):
            if self.dependencies_are_newer(self.outputs, self.inputs):
                result = True
                print("Dependencies are newer than outputs.")
                print("Running task.")
            elif self.force:
                print("Dependencies are older than inputs, but 'force' option present.")
                print("Running task.")
                result = True
            else:
                print("Dependencies are older than inputs.")
        else:
            print("No ouput file(s).")
            print("Running task.")
            result = True
        return result
6327
def getinputfiles(self, outputfile, loadmetadata=True, client=None,requiremetadata=False):
        """"""
        if isinstance(outputfile, CLAMOutputFile):
            outputfilename = str(outputfile).replace(os.path.join(self.projectpath,'output/'),'')
        else:
            outputfilename = outputfile
        outputtemplate, inputfiles = self[outputfilename]
        for inputfilename, inputtemplate in inputfiles.items():
            yield CLAMInputFile(self.projectpath, inputfilename, loadmetadata,client,requiremetadata), inputtemplate
734221
function (files) {
    if (!_.isArray(files)) files = [files];
    return _.chain(files).map(fss.target).map(function (f) {
        if (!fss.directoryExists(f)) return f;
        return fss.allTargetFilePaths(f);
    }).flatten().uniq().reject(fss.isDotFile).map(pathSuffix).value();
}
462121
def get_result_files(self, result):
        
        if isinstance(result, dict):
            result_id = result['meta']['id']
        else:  # Should already be a string containing the id
            result_id = result

        result_data_dir = os.path.join(self.get_data_dir(), result_id)

        filenames = next(os.walk(result_data_dir))[2]

        filename_path_pairs = [
            (f, os.path.join(self.get_data_dir(), result_id, f))
            for f in filenames]

        return {k: v for k, v in filename_path_pairs}
496133
def targets(self):
        
        logging.info('Performing analysis with {} targets folder'.format(self.analysistype))
        for sample in self.runmetadata:
            if sample.general.bestassemblyfile != 'NA':
                sample[self.analysistype].targetpath = \
                    os.path.join(self.targetpath, 'genera', sample[self.analysistype].genus, '')
                # There is a relatively strict databasing scheme necessary for the custom targets. Eventually,
                # there will be a helper script to combine individual files into a properly formatted combined file
                try:
                    sample[self.analysistype].mappingfile = glob('{}*.fa'
                                                                 .format(sample[self.analysistype].targetpath))[0]
                # If the fasta file is missing, raise a custom error
                except IndexError as e:
                    # noinspection PyPropertyAccess
                    e.args = ['Cannot find the combined fasta file in {}. Please note that the file must have a '
                              '.fasta extension'.format(sample[self.analysistype].targetpath)]
                    if os.path.isdir(sample[self.analysistype].targetpath):
                        raise
                    else:
                        sample.general.bestassemblyfile = 'NA'
1036529
def output_files(self):
        
        outs = [os.path.join(self.address.repo, self.address.path, x)
                for x in self.params['outs']]
        return outs
169939
def output_files(self):
        
        for dep in self.subgraph.successors(self.address):
            dep_rule = self.subgraph.node[dep]['target_obj']
            for dep_file in dep_rule.output_files:
                yield self.translate_path(dep_file, dep_rule).lstrip('/')
511586
def transform_file_output(result):
    
    from collections import OrderedDict
    new_result = []

    iterable = result if isinstance(result, list) else result.get('items', result)
    for item in iterable:
        new_entry = OrderedDict()

        entity_type = item['type']  # type property is added by transform_file_directory_result
        is_dir = entity_type == 'dir'

        new_entry['Name'] = item['name'] + '/' if is_dir else item['name']
        new_entry['Content Length'] = ' ' if is_dir else item['properties']['contentLength']
        new_entry['Type'] = item['type']
        new_entry['Last Modified'] = item['properties']['lastModified'] or ' '
        new_result.append(new_entry)
    return sorted(new_result, key=lambda k: k['Name'])
952661
def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files):
    

    content = theFile.get_text_contents()
    if Verbose:
        print(" scanning ",str(theFile))

    for i in range(len(file_tests_search)):
        if file_tests[i][0] is None:
            if Verbose:
                print("scan i ",i," files_tests[i] ",file_tests[i], file_tests[i][1])
            file_tests[i][0] = file_tests_search[i].search(content)
            if Verbose and file_tests[i][0]:
                print("   found match for ",file_tests[i][1][-1])
            # for newglossary insert the suffixes in file_tests[i]
            if file_tests[i][0] and file_tests[i][1][-1] == 'newglossary':
                findresult = file_tests_search[i].findall(content)
                for l in range(len(findresult)) :
                    (file_tests[i][1]).insert(0,'.'+findresult[l][3])
                    (file_tests[i][1]).insert(0,'.'+findresult[l][2])
                    (file_tests[i][1]).insert(0,'.'+findresult[l][0])
                    suffix_list = ['.'+findresult[l][0],'.'+findresult[l][2],'.'+findresult[l][3] ]
                    newglossary_suffix.append(suffix_list)
                if Verbose:
                    print(" new suffixes for newglossary ",newglossary_suffix)


    incResult = includeOnly_re.search(content)
    if incResult:
        aux_files.append(os.path.join(targetdir, incResult.group(1)))
    if Verbose:
        print("\include file names : ", aux_files)
    # recursively call this on each of the included files
    inc_files = [ ]
    inc_files.extend( include_re.findall(content) )
    if Verbose:
        print("files included by '%s': "%str(theFile),inc_files)
    # inc_files is list of file names as given. need to find them
    # using TEXINPUTS paths.

    for src in inc_files:
        srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False)
        if srcNode is not None:
            file_tests = ScanFiles(srcNode, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files)
    if Verbose:
        print(" done scanning ",str(theFile))
    return file_tests
1264280
def extract_files(file_paths, target_path):
        
        os.makedirs(target_path, exist_ok=True)
        extracted = []

        for file_path in file_paths:
            with tarfile.open(file_path, 'r') as archive:
                archive.extractall(target_path)

            file_name = os.path.splitext(os.path.basename(file_path))[0]
            extracted.append(os.path.join(target_path, file_name))

        return extracted
570335
def find_class_files(self):
        
        files = self._find_files()
        self.announce(
            "found '{}' compiled class files in '{}'".format(
                len(files), self.root
            )
        )
        return files
419381
def _jars_to_directories(self, target):
    
    files = set()
    jar_import_products = self.context.products.get_data(JarImportProducts)
    imports = jar_import_products.imports(target)
    for coordinate, jar in imports:
      files.add(self._extract_jar(coordinate, jar))
    return files
26924
def files(self):
        ''
        for _f in self.searchresult.files.iterchildren():
            yield ProtoFile.factory(_f, jfs=self.jfs, parentpath=unicode(_f.abspath))
627635
def get_results(self):
        
        try:
            stdout, stderr = self._lint()
            # Can't return a generator from a subprocess
            return list(stdout), stderr or []
        except FileNotFoundError as exception:
            # Error if the linter was not found but was chosen by the user
            if self._linter.name in self.config.user_linters:
                error_msg = 'Could not find {}. Did you install it? ' \
                    'Got exception: {}'.format(self._linter.name, exception)
                return [[], [error_msg]]
            # If the linter was not chosen by the user, do nothing
            return [[], []]