\
    Walks through the `path` and generates the CSV file `out`
425865
def generate_csv(path, out):
    
    known_persons = ()
    with codecs.open(os.path.join(os.path.dirname(__file__), 'person_names.txt'), 'rb', 'utf-8') as f:
        known_persons = set((l.rstrip() for l in f))
    writer = UnicodeWriter(open(out, 'wb'), delimiter=';')
    for cable in cables_from_source(path):
        content = cable.content_body
        if not content:
            continue
        persons = [person for person in known_persons if person in content]
        if persons:
            row = [cable.reference_id]
            row.extend(persons)
            writer.writerow(row)
940443
def walk(self, path = None, topdown=True):
        

        if path is None:
            path = self.root

        root = self.find(path)

        if not root.isdir():
            raise ValueError("can only walk storage types")

        if not root.child_id:
            return

        if topdown:
            storage_items = []
            stream_items = []

            for item in self.listdir(root):
                if item.isdir():
                    storage_items.append(item)
                else:
                    stream_items.append(item)

            yield root, storage_items, stream_items

            for item in storage_items:
                for root, storage_items, stream_items in self.walk(item):
                    yield root, storage_items, stream_items
        else:

            def topdown_visit_node(root):
                storage_items = []
                stream_items = []
                for item in self.listdir(root):
                    if item.isdir():
                        for sub_root, sub_storage, sub_stream in topdown_visit_node(item):
                            yield sub_root, sub_storage, sub_stream

                        storage_items.append(item)
                    else:
                        stream_items.append(item)

                yield root, storage_items, stream_items

            for root_item, storage, stream in topdown_visit_node(root):
                yield root_item, storage, stream
810838
def out_putfile(self, fpath):
        
        with open(fpath, 'w') as csv_file:
            output = csv.writer(csv_file)
            output.writerows(self.__raw_data)
1159555
def _walk_src(self, targets, flags, pipeline):
        """"""

        for target in targets:
            for f in glob.iglob(target, flags=flags | glob.S):
                if not os.path.isdir(f):
                    self.log('', 2)
                    self.log('> Processing: %s' % f, 1)
                    if pipeline:
                        try:
                            yield pipeline[0]._run_first(f)
                        except Exception as e:
                            err = self.get_error(e)
                            yield [filters.SourceText('', f, '', '', err)]
                    else:
                        try:
                            if self.default_encoding:
                                encoding = filters.PYTHON_ENCODING_NAMES.get(
                                    self.default_encoding, self.default_encoding
                                ).lower()
                                encoding = codecs.lookup(encoding).name
                            else:
                                encoding = self.default_encoding
                            yield [filters.SourceText('', f, encoding, 'file')]
                        except Exception as e:
                            err = self.get_error(e)
                            yield [filters.SourceText('', f, '', '', err)]
1012969
def write_csv(path, data):
    """"""

    fd = _try_open_file(path, 'w',
                        'The first argument must be a pathname or an object that supports write() method')
    for v in data:
        fd.write(",".join([str(x) for x in v]))
        fd.write("\n")
    _try_close_file(fd, path)
110443
def fetch_file(self, in_path, out_path):
        
        output = self.get_chain().call(
            ansible_mitogen.target.read_path,
            mitogen.utils.cast(in_path),
        )
        ansible_mitogen.target.write_path(out_path, output)
1195346
def _walk(path, follow_links=False, maximum_depth=None):
    """"""
    root_level = path.rstrip(os.path.sep).count(os.path.sep)
    for root, dirs, files in os.walk(path, followlinks=follow_links):
        yield root, dirs, files
        if maximum_depth is None:
            continue

        if root_level + maximum_depth <= root.count(os.path.sep):
            del dirs[:]
1283778
function (output) {
              // Manually convert paths to relative, because LESS
              // can make tose absolute for complex cases.
              var map = JSON.parse(output);
              var dir = path.dirname(context.pathname);
              map.sources.forEach(function (file, idx) {
                var rel = path.relative(dir, file);
                if (path.sep === '\\') { rel = rel.replace('\\', '/'); }
                map.sources[idx] = rel;
              });

              self.map = JSON.stringify(map);
            }
1086990
def _stream_out(self, outfile, append=False):
        '''
        
        '''
        if type(outfile) in (str, unicode):
            outfile = os.path.expanduser(os.path.expandvars(outfile))
            outfile = open(outfile, 'a' if append else 'w')
        self._run(outfile)
        self._pop.wait()
63943
def _output_path(self, input_path, to_format, archive=False):
        
        indirpath, fname = os.path.split(os.path.abspath(os.path.normpath(input_path)))

        commonprefix = os.path.commonprefix([os.path.abspath(self.file_generator.from_path),
                                             os.path.abspath(indirpath)])

        commonparts = commonprefix.split(os.sep)
        inparts = indirpath.split(os.sep)
        outparts = inparts[len(commonparts):]

        if archive:
            outdirpath = os.path.join(*outparts) if outparts else ""
        else:
            outdirpath = os.path.join(self.file_generator.to_path, *outparts)

        return os.path.join(outdirpath, fname + self.file_generator.file_extension[to_format])
795733
def __output_path(toolchain, rule, output_dir):
    """"""
    filename = '%s_%s.json' % (toolchain, rule)
    return os.path.join(output_dir, filename)
348194
def output path, do_file_close = true
      FileUtils.cp @file.path, path
      close if do_file_close
      self
    end
245518
public void generateCSV() {
        
        int cont = 0;
        int algorithmSize = this.streams.get(0).algorithm.size();
        int streamSize = this.streams.size();
        int measureSize = this.streams.get(0).algorithm.get(0).measures.size();
        
        while (cont != measureSize) {
            String output = "";
            output += "Algorithm,";
            output += this.streams.get(0).algorithm.get(0).name;
            //Inicialize summary table
            
            for (int i = 1; i < algorithmSize; i++) {
                output += "," + this.streams.get(0).algorithm.get(i).name;
               
            }
            output += "\n";

            for (int i = 0; i < streamSize; i++) {
                List<Algorithm> alg = this.streams.get(i).algorithm;
                output += this.streams.get(i).name;
                for (int j = 0; j < algorithmSize; j++) {
                    output += "," + alg.get(j).measures.get(cont).getValue();
                    
                }
                output += "\n";
            }
            //PrintStream out = null;
            String name = this.streams.get(0).algorithm.get(0).measures.get(cont).getName();
//            try {
//                out = new PrintStream(new BufferedOutputStream(new FileOutputStream(path + name + ".csv")));
//            } catch (FileNotFoundException ex) {
//                Logger.getLogger(Summary.class.getName()).log(Level.SEVERE, null, ex);
//            }
//            System.setOut(out);
//            System.out.println(output);
//            out.close();
            try {
            BufferedWriter out = new BufferedWriter(new FileWriter(path + name + ".csv"));
            out.write(output);  //Replace with the string 
            //you are trying to write  
            out.close();
        } catch (IOException e) {
            System.out.println(name + ".csv");

        }
            cont++;
        }

    }
841292
def output_path
      Pathname.new File.join(Massimo.config.output_path, url.sub(/^#{Regexp.escape(Massimo.config.base_url)}/, ''))
    end
1019725
def _import_csv(self, path):
        """"""

        # If path is not set, do nothing
        if not path:
            return

        # Get csv info

        try:
            dialect, has_header, digest_types, encoding = \
                self.main_window.interfaces.get_csv_import_info(path)

        except IOError:
            msg = _("Error opening file {filepath}.").format(filepath=path)
            post_command_event(self.main_window, self.StatusBarMsg, text=msg)
            return

        except TypeError:
            return  # Import is aborted or empty

        return CsvInterface(self.main_window,
                            path, dialect, digest_types, has_header, encoding)
170551
def _walk(self, root_path=''):
        '''  '''
        title = '%s._walk' % self.__class__.__name__
        if root_path:
            root_path = '/%s' % root_path
        try:
            response = self.dropbox.files_list_folder(path=root_path, recursive=True)
            for record in response.entries:
                if not isinstance(record, self.objects.FileMetadata):
                    continue
                yield record.path_display[1:]
            if response.has_more:
                while response.has_more:
                    response = self.dropbox.files_list_folder_continue(response.cursor)
                    for record in response.entries:
                        if not isinstance(record, self.objects.FileMetadata):
                            continue
                        yield record.path_display[1:]
        except:
            raise DropboxConnectionError(title)
1125092
def recwalk(inputpath, sorting=True):
    ''''''
    # If it's only a single file, return this single file
    if os.path.isfile(inputpath):
        abs_path = fullpath(inputpath)
        yield os.path.dirname(abs_path), os.path.basename(abs_path)
    # Else if it's a folder, walk recursively and return every files
    else:
        for dirpath, dirs, files in walk(inputpath):	
            if sorting:
                files.sort()
                dirs.sort() # sort directories in-place for ordered recursive walking
            for filename in files:
                yield (dirpath, filename)