input: local repo path
    output: path list of files which need to be rendered
343543
def get_template_filelist(repo_path, ignore_files=[], ignore_folders=[]):
    

    default_ignore_files = ['.gitignore']
    default_ignore_folders = ['.git']

    ignore_files += default_ignore_files
    ignore_folders += default_ignore_folders

    filelist = []

    for root, folders, files in os.walk(repo_path):
        for ignore_file in ignore_files:
            if ignore_file in files:
                files.remove(ignore_file)

        for ignore_folder in ignore_folders:
            if ignore_folder in folders:
                folders.remove(ignore_folder)

        for file_name in files:
            filelist.append( '%s/%s' % (root, file_name))

    return filelist
636535
def _get_files(self):
        
        excludes = [
            '.git',
            '.tox',
            '.vagrant',
            '.venv',
            os.path.basename(self._config.verifier.directory),
        ]
        generators = [
            util.os_walk(self._config.project_directory, '*.yml', excludes),
            util.os_walk(self._config.project_directory, '*.yaml', excludes),
        ]

        return [f for g in generators for f in g]
183431
def render_source(output_dir, package_spec):
  
  path, name = package_spec.filepath
  module_prefix = "SwiftNav.SBP"
  module_name = camel_case(name)
  full_module_name = ".".join([module_prefix, module_name])
  destination_filename = "%s/src/SwiftNav/SBP/%s.hs" % (output_dir, module_name)
  py_template = JENV.get_template(MESSAGES_TEMPLATE_NAME)
  module_includes = [".".join([module_prefix] + [camel_case(j) for j in i.split(".")[:-1]])
                     for i in package_spec.includes]

  with open(destination_filename, 'w') as f:
    f.write(py_template.render(msgs=package_spec.definitions,
                               description=package_spec.description,
                               module_name=full_module_name,
                               module_includes=module_includes))
1037365
def get_repo_content(path):
    
    path = Path(path)

    if zipfile.is_zipfile(str(path)):
        with zipfile.ZipFile(str(path)) as zz:
            filelist = [info.filename for info in zz.infolist()]
        iszip = True
    else:
        iszip = False
        filelist = [str(f) for f in path.glob('**/*') if f.is_file()]
    return namedtuple('repocontent', ['iszip', 'filelist'])(iszip, filelist)
1158741
def render_relative_path(export_path, path)
      export_path = Pathname.new(export_path)
      path = Pathname.new(path).relative_path_from(export_path)
      return path.to_path
    end
128254
def file_list(self, tgt_env):
        '''
        
        '''
        def _traverse(tree, blobs, prefix):
            '''
            Traverse through a pygit2 Tree object recursively, accumulating all
            the file paths and symlink info in the "blobs" dict
            '''
            for entry in iter(tree):
                if entry.oid not in self.repo:
                    # Entry is a submodule, skip it
                    continue
                obj = self.repo[entry.oid]
                if isinstance(obj, pygit2.Blob):
                    repo_path = salt.utils.path.join(
                        prefix, entry.name, use_posixpath=True)
                    blobs.setdefault('files', []).append(repo_path)
                    if stat.S_ISLNK(tree[entry.name].filemode):
                        link_tgt = self.repo[tree[entry.name].oid].data
                        blobs.setdefault('symlinks', {})[repo_path] = link_tgt
                elif isinstance(obj, pygit2.Tree):
                    _traverse(
                        obj, blobs, salt.utils.path.join(
                            prefix, entry.name, use_posixpath=True)
                    )

        files = set()
        symlinks = {}
        tree = self.get_tree(tgt_env)
        if not tree:
            # Not found, return empty objects
            return files, symlinks
        if self.root(tgt_env):
            try:
                # This might need to be changed to account for a root that
                # spans more than one directory
                oid = tree[self.root(tgt_env)].oid
                tree = self.repo[oid]
            except KeyError:
                return files, symlinks
            if not isinstance(tree, pygit2.Tree):
                return files, symlinks
            relpath = lambda path: os.path.relpath(path, self.root(tgt_env))
        else:
            relpath = lambda path: path
        blobs = {}
        if tree:
            _traverse(tree, blobs, self.root(tgt_env))
        add_mountpoint = lambda path: salt.utils.path.join(
            self.mountpoint(tgt_env), path, use_posixpath=True)
        for repo_path in blobs.get('files', []):
            files.add(add_mountpoint(relpath(repo_path)))
        for repo_path, link_tgt in six.iteritems(blobs.get('symlinks', {})):
            symlinks[add_mountpoint(relpath(repo_path))] = link_tgt
        return files, symlinks
155165
def do_list(self, line):
        '''
        
        '''
        repo_names = self.network.repo_names
        print('Known repos:')
        print('    ' + '\n    '.join(repo_names))
984425
def render_source(output_dir, package_spec, jenv=JENV):
  
  path, module_name = package_spec.filepath
  java_template = jenv.get_template(TEMPLATE_NAME)
  module_path = "com." + package_spec.identifier
  yaml_filepath = "/".join(package_spec.filepath) + ".yaml"
  includes = [".".join(i.split(".")[:-1]) for i in package_spec.includes]
  includes = [i for i in includes if i != "types"]
  for msg in package_spec.definitions:
    msg_name = classnameify(msg.identifier) if msg.sbp_id else msg.identifier
    l = "/".join(package_spec.filepath)
    destination_filename = "%s/com/%s/%s.java" % (output_dir, l , msg_name)

    # Create the output directory if it doesn't exist
    if not os.path.exists(os.path.dirname(destination_filename)):
      os.mkdir(os.path.dirname(destination_filename))

    with open(destination_filename, 'w+') as f:
        print(destination_filename)
        f.write(java_template.render(m=msg,
                                     filepath=yaml_filepath,
                                     module_path=module_path,
                                     include=includes,
                                     description=package_spec.description))
248353
function(){
		var options = render.options,
			path = options.render = render._normalizePath( options.render );

		// Ensure render path actually exists
		fs.stat( path, function( e, stat ) {
			if ( e || ! stat || ! stat.isDirectory() ) {
				return munit.exit( 1, e, "'" + path + "' is not a directory" );
			}

			// Check for root munit config file
			fs.exists( path + '/munit.js', function( exists ) {
				if ( exists ) {
					munit.require( path + '/munit.js' );
				}

				// Initialize all files in test path for submodule additions
				render._renderPath( path, function( e ) {
					if ( e ) {
						return munit.exit( 1, e, "Unable to render test path" );
					}

					render._compile();
				});
			});
		});
	}
600095
def render_files(self, root=None):
        
        if root is None:
            tmp =  os.environ.get('TMP')
            root = sys.path[1 if tmp and tmp in sys.path else 0]
        items = []
        for filename in os.listdir(root):
            # for subdirname in dirnames:
            #     path = os.path.join(dirname, subdirname)
            #     items.append(FOLDER_TMPL.format(
            #         name=subdirname,
            #         id=path,
            #         items=self.render_files(path)
            #     ))
            #for filename in filenames:
            f,ext = os.path.splitext(filename)
            if ext in ['.py', '.enaml']:
                items.append(FILE_TMPL.format(
                    name=filename,
                    id=filename
                ))

        return "".join(items)
737300
def local_repo
      @local_repo ||= begin
        ignored_dirs = (config[:ignore_directories] || []).map {|e| File.expand_path(e) }
        dir = ["lib/boson", ".boson"].find {|e| File.directory?(e) &&
            File.expand_path(e) != repo.dir && !ignored_dirs.include?(File.expand_path('.')) }
        Repo.new(dir) if dir
      end
    end
597583
def files_in_path(path):
    
    aggregated_files = []

    for dir_, _, files in os.walk(path):
        for file in files:
            relative_dir = os.path.relpath(dir_, path)

            if ".git" not in relative_dir:
                relative_file = os.path.join(relative_dir, file)
                aggregated_files.append(relative_file)

    return aggregated_files
582831
def get_dir(path, dest, saltenv='base', template=None, gzip=None, **kwargs):
    '''
    
    '''
    (path, dest) = _render_filenames(path, dest, saltenv, template, **kwargs)

    return _client().get_dir(path, dest, saltenv, gzip)
538086
def get_path_to_repo(self, repo: str) -> Path:
        
        return Path(self.base_dir) / "repos" / self.repo_id(repo)
1231295
def list(self, path=None, with_metadata=False, include_partitions=False):
        ''''''
        import json

        sub_path = self.prefix + '/' + path.strip('/') if path else self.prefix

        l = {}

        for e in self.bucket.list(sub_path):

            path = e.name.replace(self.prefix, '', 1).strip('/')
            if path.startswith('_') or path.startswith('meta'):
                continue

            # TODO 'include_partitions' doesn't make any sense outside of ambry
            if not include_partitions and path.count('/') > 1:
                continue  # partition files

            if with_metadata:
                d = self.metadata(path)
                if d and 'identity' in d:
                    d['identity'] = json.loads(d['identity'])
            else:
                d = {}

            d['caches'] = [self.repo_id]

            if path:
                l[path] = d

        return l
291090
def main(argv=None):
    
    # Get command line arguments, validate them, and normalize them
    opts = cmdparse.parse_args(argv)
    assert validate_opts.validate(opts)
    opts = normalize_opts.normalize(opts)

    if opts.verbose:
        # Update client: print input and output directories
        messages.print_input_output(opts)

    file_paths = fileparse.get_file_list(opts)
    assert validate_files.validate(file_paths, opts)

    if opts.verbose and opts.is_dir:
        # Update client: print files that will be parsed
        messages.print_files(opts, file_paths)

    # For now, only using default GitHub Markdown for parsing
    # Collect tag/anchor combinations
    collector = make_github_markdown_collector(opts)
    anchors, duplicate_tags = collector.collect(file_paths)
    assert validate_anchors.validate(anchors, duplicate_tags, opts)

    # Write files using previously found AnchorHub tags and generated anchors
    writer = make_github_markdown_writer(opts)
    counter = writer.write(file_paths, anchors, opts)

    if opts.verbose:
        if opts.is_dir:
            # Update client: print files that had modifications
            messages.print_modified_files(opts, anchors)
        # Print summary statistics
        messages.print_summary_stats(counter)
1276014
def get_path(src):  # pragma: no cover
    
    res = None
    while not res:
        if res is False:
            print(colored('You must provide a path to an existing directory!', 'red'))
        print('You need a local clone or release of (a fork of) '
              'https://github.com/{0}'.format(src))
        res = input(colored('Local path to {0}: '.format(src), 'green', attrs=['blink']))
        if res and Path(res).exists():
            return Path(res).resolve()
        res = False