Function to copy readme files to their dist folder
430761
function copyReadmeFiles() {
    const resolvedSrcReadmePaths = path.resolve(rootDir, srcReadmePaths);

    glob(resolvedSrcReadmePaths, void(0), function(error, files) {
        files.forEach((filePath) => {
        const destReadmePath = filePath.replace(/(\bsrc\b)(?!.*\1)/, destDir);
            fs.copyFileSync(filePath, destReadmePath);
        });
    });
}
1344771
def gather_readme(self):
        
        if not os.path.exists(self.paths["readme"]):
            return ""

        return utils.file_to_string(self.paths["readme"])
391561
function copy(copiesMap, projectsPath, buildPath) {
            return _.map(copiesMap, function(dstPath, srcPath) {
                if (/\/$/.test(dstPath)) {
                    //copy directory
                    return gulp.src(path.join(projectsPath, srcPath))
                        .pipe(gulp.dest(path.join(buildPath, dstPath)));
                } else {
                    //copy file
                    return gulp.src(path.join(projectsPath, srcPath))
                        .pipe(gulpRename(dstPath))
                        .pipe(gulp.dest(buildPath));
                };
            });
        }
188806
function fsReaddirSync(root, files, fp) {
  if (typeof root !== 'string') {
    throw new TypeError('fsReaddir.sync: expect `root` to be string');
  }

  fp = fp || '';
  files = files || [];

  var dir = path.join(root, fp);
  if (fs.statSync(dir).isDirectory()) {
    fs.readdirSync(dir).forEach(function(name) {
      fsReaddirSync(root, files, path.join(dir, name));
    });
  } else {
    files.push(fp);
  }

  return files;
}
569288
function copyToOut(src, out, multiFileMode) {
    try {
        fs.copySync(src, out);
        fs.statSync(out)
        return out;
    } catch (err) {
    }
}
79640
function copyFolder(ffs, from, to) {
    checkFolder(ffs, to);
    let tasks = [];
    ffs.readdirSync(from).forEach(child => {
        if (ffs.statSync(from + '/' + child).isDirectory()) {
            copyFolder(ffs, from + '/' + child, to + '/' + child);
        }
        else {
            copyFile(ffs, from + '/' + child, to + '/' + child);
        }
    });
}
886788
function copyDirSync(src, dest) {
  if (fs.lstatSync(src).isDirectory()) {
    const files = fs.readdirSync(src);
    files.forEach((file) => {
      const curSource = path.join(src, file);
      const curDest = path.join(dest, file);
      if (fs.lstatSync(curSource).isDirectory()) {
        if (!fs.existsSync(curDest)) {
          createDir(curDest);
        }
        copyDirSync(curSource, curDest);
      } else {
        copyFileSync(curSource, curDest);
      }
    });
  }
}
203607
function exportReadme(readmePath) {
    const readmePaths = path.resolve(process.cwd(), srcDir);

    glob(readmePaths, void(0), function(error, files) {
        files.forEach((filePath) => {
            let documentation = startFile;
            const markdown = fs.readFileSync(filePath, "utf8");
            const exportPath = filePath.replace(/README\.md/, readmePath);

            if (markdown.length !== 0) {
                documentation += md.render(markdown);
            } else {
                documentation += emptyFile;
            }

            documentation += endFile;
            
            if (!fs.existsSync(exportPath)){
                fs.mkdirSync(exportPath);
            }

            fs.writeFileSync(path.resolve(exportPath, "documentation.tsx"), documentation);
        });
    });
}
486174
def get_readme():
    """"""
    base_dir = path.abspath(path.dirname(__file__))
    with open(path.join(base_dir, 'README.md'), encoding='utf-8') as readme_f:
        return readme_f.read()
62435
function copyFile (oldName, newName) {
    let contents = fs.readFileSync (oldName, 'utf8')
    fs.truncateSync (newName)
    fs.writeFileSync (newName, contents)
}
100208
function copyFile(source, dest) {

  fs.stat(dest, function (err, stats) {

    // If there was an error that is NOT that the file doesn't exist, then throw it.
    if (err && err.code !== 'ENOENT') {
      throw new Error(err);
    }

    // If the file exists then skip it.
    if (typeof stats === 'object') {
      process.stdout.write(`File exists: skipping (${dest})\n`);
    }

    return fs.createReadStream(source)
      .pipe(fs.createWriteStream(dest));

  });

}
583202
def process_readme():
    
    with open('../../README.md', 'r') as file:
        readme = file.read()

    readme = readme.replace('# eo-learn', '# Introduction').replace('docs/source/', '')
    readme = readme.replace('**`', '**').replace('`**', '**')

    chapters = [[]]
    for line in readme.split('\n'):
        if line.strip().startswith('## '):
            chapters.append([])
        if line.startswith('<img'):
            line = '<p></p>'

        chapters[-1].append(line)

    chapters = ['\n'.join(chapter) for chapter in chapters]

    intro = '\n'.join([chapter for chapter in chapters if not (chapter.startswith('## Install') or
                                                               chapter.startswith('## Documentation'))])
    install = '\n'.join([chapter for chapter in chapters if chapter.startswith('## Install')])

    with open(os.path.join(MARKDOWNS_FOLDER, 'INTRO.md'), 'w') as file:
        file.write(intro)
    with open(os.path.join(MARKDOWNS_FOLDER, 'INSTALL.md'), 'w') as file:
        file.write(install)
552874
function copy() {

		// Copy dist files
		var distFolder = Release.dir.dist + "/dist",
			externalFolder = Release.dir.dist + "/external",
			readme = fs.readFileSync( Release.dir.dist + "/README.md", "utf8" ),
			rmIgnore = files
				.concat( [
					"README.md",
					"node_modules"
				] )
				.map( function( file ) {
					return Release.dir.dist + "/" + file;
				} );

		shell.config.globOptions = {
			ignore: rmIgnore
		};

		// Remove extraneous files before copy
		shell.rm( "-rf", Release.dir.dist + "/**/*" );

		shell.mkdir( "-p", distFolder );
		files.forEach( function( file ) {
			shell.cp( "-f", Release.dir.repo + "/" + file, distFolder );
		} );

		// Copy Sizzle
		shell.mkdir( "-p", externalFolder );
		shell.cp( "-rf", Release.dir.repo + "/external/sizzle", externalFolder );

		// Copy other files
		extras.forEach( function( file ) {
			shell.cp( "-rf", Release.dir.repo + "/" + file, Release.dir.dist );
		} );

		// Remove the wrapper from the dist repo
		shell.rm( "-f", Release.dir.dist + "/src/wrapper.js" );

		// Write generated bower file
		fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() );

		fs.writeFileSync( Release.dir.dist + "/README.md", editReadme( readme ) );

		console.log( "Files ready to add." );
		console.log( "Edit the dist README.md to include the latest blog post link." );
	}
340248
function dist() {
	if (test('-d', DIST_DIR)) {
		rm('-r', DIST_DIR + '*');
	} else {
		mkdir(DIST_DIR);
	}

	[{
		name: DIST_NATIVE_NAME,
		files: SRC_NATIVE_FILES,
		testingFiles: TESTING_NATIVE_FILES
	}, {
		name: DIST_JQUERY_NAME,
		files: SRC_JQUERY_FILES,
		testingFiles: TESTING_JQUERY_FILES
	}, {
		name: DIST_NAME,
		files: SRC_NATIVE_FILES,
		testingFiles: TESTING_NATIVE_FILES
	}].forEach(function(config){
		generateDistFiles(config);
	});
}
396715
def copydir(orig, dest):
    

    copied = list()

    makedirsp(dest)

    for root, dirs, files in walk(orig):
        for d in dirs:
            # ensure directories exist
            makedirsp(join(dest, d))

        for f in files:
            root_f = join(root, f)
            dest_f = join(dest, relpath(root_f, orig))
            copy(root_f, dest_f)
            copied.append((root_f, dest_f))

    return copied
281410
def _copy(src_file, dest_path):
  """"""
  tf.io.gfile.makedirs(os.path.dirname(dest_path))
  with tf.io.gfile.GFile(dest_path, 'wb') as dest_file:
    while True:
      data = src_file.read(io.DEFAULT_BUFFER_SIZE)
      if not data:
        break
      dest_file.write(data)
369050
def get_readme():
    ''

    here = path.abspath(path.dirname(__file__))
    with open(path.join(here, 'README.rst'), encoding='utf-8') as my_fd:
        result = my_fd.read()

    return result