Suggest MANIFEST.in patterns for missing files.
357529
def find_suggestions(filelist):
    """"""
    suggestions = set()
    unknowns = []
    for filename in filelist:
        if os.path.isdir(filename):
            # it's impossible to add empty directories via MANIFEST.in anyway,
            # and non-empty directories will be added automatically when we
            # specify patterns for files inside them
            continue
        for pattern, suggestion in SUGGESTIONS:
            m = pattern.match(filename)
            if m is not None:
                suggestions.add(pattern.sub(suggestion, filename))
                break
        else:
            unknowns.append(filename)
    return sorted(suggestions), unknowns
1150838
def iterate_presentation_files(path=None, excludes=None, includes=None):
    """"""

    # Defaults
    if includes is None:
        includes = []
    if excludes is None:
        excludes = []

    # Transform glob patterns to regular expressions
    includes_pattern = r'|'.join([fnmatch.translate(x) for x in includes]) or r'$.'
    excludes_pattern = r'|'.join([fnmatch.translate(x) for x in excludes]) or r'$.'
    includes_re = re.compile(includes_pattern)
    excludes_re = re.compile(excludes_pattern)

    def included(root, name):
        """Returns True if the specified file is a presentation file."""
        full_path = os.path.join(root, name)
        # Explicitly included files takes priority
        if includes_re.match(full_path):
            return True
        # Ignore special and excluded files
        return (not specials_re.match(name)
            and not excludes_re.match(full_path))

    # Get a filtered list of paths to be built
    for root, dirs, files in os.walk(path):
        dirs[:] = [d for d in dirs if included(root, d)]
        files = [f for f in files if included(root, f)]
        for f in files:
            yield os.path.relpath(os.path.join(root, f), path)
284521
def find_sources(self):
        """"""
        manifest_filename = os.path.join(self.egg_info, "SOURCES.txt")
        mm = manifest_maker(self.distribution)
        mm.manifest = manifest_filename
        mm.run()
        self.filelist = mm.filelist
409219
def __add_images_to_manifest(self):
        """"""

        xpath_expr = "//manifest:manifest[1]"

        for content_tree in self.content_trees:

            # Find manifest:manifest tags.
            manifest_e = content_tree.xpath(
                xpath_expr,
                namespaces=self.namespaces
            )
            if not manifest_e:
                continue

            for identifier in self.images.keys():
                # Add a manifest:file-entry tag.
                lxml.etree.SubElement(
                    manifest_e[0],
                    '{%s}file-entry' % self.namespaces['manifest'],
                    attrib={
                        '{%s}full-path' % self.namespaces['manifest']: (
                            PY3O_IMAGE_PREFIX + identifier
                        ),
                        '{%s}media-type' % self.namespaces['manifest']: '',
                    }
                )
838172
function (manifest, file, callback) {
            generate(file.src, options, function (err, sriData) {
                // Make relative if a cwd is specified
                if (file.orig && file.orig.cwd) {
                    file.id = file.id.replace(file.orig.cwd, "");
                    sriData.path = sriData.path.replace(file.orig.cwd, "");
                }
                // Attach a property to the WIP manifest object
                manifest[file.id] = sriData;
                callback(err, manifest);
            });
        }
337258
def jarManifest(target, source, env, for_signature):
    """"""
    for src in source:
        contents = src.get_text_contents()
        if contents[:16] == "Manifest-Version":
            return src
    return ''
524579
function (err, manifest) {
            if (err) {
                // Error generating SRI hashes
                grunt.log.error("Error loading resource: " + err);
                return done(false);
            }

            return saveJson(
                options,
                manifest,
                writeLog(fileCount, done)
            );
        }
1273139
function selectMissing(missing, manifest, fn) {
  fn(null, manifest.filter(function(file) {
    return file && ~missing.indexOf(file.hash);
  }));
}
658844
def check(self):
        

        #for path in self.path.values():
        #    if not os.path.exists(path):
        #        raise RuntimeError("File '{}' is missing".format(path))

        for tool in ('cd-hit', 'prank', 'hmmbuild', 'hmmpress', 'hmmscan', 'phmmer', 'mafft', 'meme'):
            if not self.pathfinder.exists(tool):
                raise RuntimeError("Dependency {} is missing".format(tool))
389439
function (manifest) {
  return {
    startPage: manifest.startPage,
    srcDirectory: manifest.srcDirectory,
    name: manifest.name,
    exposeExperimentalAPIs: true
  }
}
572174
def prep_files(paths, extensions):
    """"""

    from batchpath import GeneratePaths

    filenames = GeneratePaths().files(paths, os.W_OK, extensions, 0, True)

    if filenames:
        return filenames
    else:
        LOGGER.error('No valid targets were specified')
        sys.exit(1)
1261872
function(done) {
                var source = __dirname + '/manifest.json';
                var dest = self.dir + '/manifest.json';

                fs.readFile(source, function(err, manifest) {
                    if (err) return done(err);

                    manifest = JSON.parse(manifest);
                    manifest.permissions.push.apply(manifest.permissions, settings.permissions);

                    fs.writeFile(dest, JSON.stringify(manifest, null, '\t'), done);
                });
            }
1329205
function writeManifest (archive, manifest, cb) {
  manifest = generateManifest(manifest)
  return writeFile(archive, DAT_MANIFEST_FILENAME, JSON.stringify(manifest, null, 2), cb)
}
1008229
def list_items(path_to_directory, pattern, wanted):
    """"""
    if not path_to_directory:
        return set()
    needed = make_needed(pattern, path_to_directory, wanted)
    return [os.path.join(path_to_directory, name)
            for name in _names_in_directory(path_to_directory)
            if needed(name)]
1098288
def find_manifest_changes(new_file_state, old_file_state):
    
    prev_state_dict = copy.deepcopy(old_file_state)
    changed_files = {}

    # Find files which are new on the server
    for itm in new_file_state:
        if itm['path'] in prev_state_dict:
            d_itm = prev_state_dict.pop(itm['path'])

            # If the file has been modified
            if itm['last_mod'] != d_itm['last_mod']:
                n_itm = itm.copy()
                n_itm['status'] = 'changed'
                changed_files[itm['path']] = n_itm
            else:
                pass # The file has not changed

        else:
            n_itm = itm.copy()
            n_itm['status'] = 'new'
            changed_files[itm['path']] = n_itm

    # any files remaining in the old file state have been deleted locally
    for itm in prev_state_dict.itervalues():
        n_itm = itm.copy()
        n_itm['status'] = 'deleted'
        changed_files[itm['path']] = n_itm

    return changed_files
1157698
private static InternetHeaders getManifestProperties(File manifest) {
        final InternetHeaders result = new InternetHeaders();
        if (null == manifest) {
            LOGGER.debug("Manifest file not found.");
        } else {
            try (InputStream in = new BufferedInputStream(new FileInputStream(manifest))) {
                result.load(in);
            } catch (MessagingException | FileNotFoundException e) {
                LOGGER.warn(e.getMessage(), e);
            } catch (IOException ex) {
                LOGGER.warn(ex.getMessage(), ex);
            }
        }
        return result;
    }
1139895
def get_suggestion(self, front_path):
        
        if '/' in front_path:
            # transverse the manifest, return the new manifest, then
            # get those suggestions with the remaining word
            splitted = front_path.split('/')
            new_manifest = self.manifest
            pre_path = ''
            for item in splitted:
                try:
                    new_manifest = new_manifest[item]
                except KeyError:
                    partial_word = item
                    break
                else:
                    pre_path += item + '/'

            if isinstance(new_manifest, Program):
                return []
            matches = new_manifest._get_suggestions(partial_word)
            return [pre_path + match for match in matches]
        else:
            return self._get_suggestions(front_path or None)