Copy the stubs directory
197243
private function copyStubsDirectory()
    {
        $path = $this->option('path');

        // if controller stub already exist
        if ($this->files->exists($path . DIRECTORY_SEPARATOR . 'controller.stub') && $this->option('force') === false) {
            $this->error("Stubs already exists! Run 'generate:publish-stubs --force' to override the stubs.");
            die;
        }

        File::copyDirectory(__DIR__ . '/../../resources/stubs', $path);
    }
748687
def copy_files(src_dir, dst_dir, filespec='*', recursive=False):
    
    import os
    from .modules import copyfiles

    if src_dir == dst_dir:
        raise RuntimeError('copy_files() src and dst directories must be different.')

    if not os.path.isdir(src_dir):
        raise RuntimeError('copy_files() src directory "{}" does not exist.'.format(src_dir))

    return {
        'dependencies_fn': copyfiles.list_files,
        'compiler_fn': copyfiles.copy_files,
        'input': src_dir,
        'output': dst_dir,
        'kwargs': {
            'filespec': filespec,
            'recursive': recursive,
        },
    }
1054073
function copyFiles(srcfile, dstfile, callback) {
        var fs = require("fs");
        var rs = fs.createReadStream(srcfile);
        var ws = fs.createWriteStream(dstfile);
        rs.on("data", function(d) {
            ws.write(d);
        });
        rs.on("end", function() {
            ws.end();
            callback(true);
        });
    }
690572
def copy_tree(src, dst):
    """"""
    for root, subdirs, files in os.walk(src):
        current_dest = root.replace(src, dst)
        if not os.path.exists(current_dest):
            os.makedirs(current_dest)
        for f in files:
            shutil.copy(os.path.join(root, f), os.path.join(current_dest, f))
920812
protected function copyAssets()
    {
        $packagePath = $this->packagePath();

        if ($this->useWindows()) {
            $source = $packagePath."/public/assets";
        } else {
            $source = $packagePath."/public/assets/";
        }
        $destination = $this->normalizePath(public_path('assets'));
        if (! File::exists($source)) {
            File::makeDirectory($source);
        }
        if (! File::exists($destination)) {
            File::makeDirectory($destination);
        }
        $copyAssetsCommand = $this->copyCommand().' '.$this->copyOptions().' "'.$source.'" "'.$destination.'" > nul';

        shell_exec($copyAssetsCommand);
    }
852512
def copy_resource(src, dest):
    
    package_name = "yass"
    dest = (dest + "/" + os.path.basename(src)).rstrip("/")
    if pkg_resources.resource_isdir(package_name, src):
        if not os.path.isdir(dest):
            os.makedirs(dest)
        for res in pkg_resources.resource_listdir(__name__, src):
            copy_resource(src + "/" + res, dest)
    else:
        if not os.path.isfile(dest) \
                and os.path.splitext(src)[1] not in [".pyc"]:
            with open(dest, "wb") as f:
                f.write(pkg_resources.resource_string(__name__, src))
        else:
            print("File exists: %s " % dest)
428304
def copyHdfsDirectoryToLocal(hdfsDirectory, localDirectory, hdfsClient):
    ''''''
    if not os.path.exists(localDirectory):
        os.makedirs(localDirectory)
    try:
        listing = hdfsClient.list_status(hdfsDirectory)
    except Exception as exception:
        nni_log(LogType.Error, 'List hdfs directory {0} error: {1}'.format(hdfsDirectory, str(exception)))
        raise exception

    for f in listing:
        if f.type == 'DIRECTORY':
            subHdfsDirectory = posixpath.join(hdfsDirectory, f.pathSuffix)
            subLocalDirectory = os.path.join(localDirectory, f.pathSuffix)
            copyHdfsDirectoryToLocal(subHdfsDirectory, subLocalDirectory, hdfsClient)
        elif f.type == 'FILE':
            hdfsFilePath = posixpath.join(hdfsDirectory, f.pathSuffix)
            localFilePath = os.path.join(localDirectory, f.pathSuffix)            
            copyHdfsFileToLocal(hdfsFilePath, localFilePath, hdfsClient)
        else: 
            raise AssertionError('unexpected type {}'.format(f.type))
120156
def stub(self, obj, attr=None):
        '''
        
        '''
        s = stub(obj, attr)
        if s not in self._stubs:
            self._stubs.append(s)
        return s
307054
protected void copyJarsToStageDirectory() throws IOException {
        final String stagingDirectory = getDeploymentStagingDirectoryPath();
        info("");
        info(COPY_JARS + stagingDirectory);
        Utils.copyResources(
                getProject(),
                getSession(),
                getMavenResourcesFiltering(),
                getResources(),
                stagingDirectory);
        info(COPY_SUCCESS);
    }
931769
def workspace_clone(ctx, clobber_mets, download, mets_url, workspace_dir):
    
    workspace = ctx.resolver.workspace_from_url(
        mets_url,
        dst_dir=os.path.abspath(workspace_dir if workspace_dir else mkdtemp(prefix=TMP_PREFIX)),
        mets_basename=ctx.mets_basename,
        clobber_mets=clobber_mets,
        download=download,
    )
    workspace.save_mets()
    print(workspace.directory)
1117149
def copy_artifacts(app):
    """"""
    dest_path = app.builder.outdir + '/error'
    source_path = app.builder.srcdir + '/build_version_doc/artifacts'
    _run_cmd('cd ' + app.builder.srcdir)
    _run_cmd('rm -rf ' + dest_path)
    _run_cmd('mkdir -p ' + dest_path)
    _run_cmd('cp ' + source_path + '/404.html ' + dest_path)
    _run_cmd('cp ' + source_path + '/api.html ' + dest_path)
    dest_path = app.builder.outdir + '/_static'
    _run_cmd('rm -rf ' + dest_path)
    _run_cmd('mkdir -p ' + dest_path)
    _run_cmd('cp ' + app.builder.srcdir + '/_static/mxnet.css ' + dest_path)
585919
function copyTemplateDir (srcDir, outDir, vars, cb) {
  if (!cb) {
    if (!vars) vars = noop
    cb = vars
    vars = {}
  }

  assert.equal(typeof srcDir, 'string')
  assert.equal(typeof outDir, 'string')
  assert.equal(typeof vars, 'object')
  assert.equal(typeof cb, 'function')

  // create directory
  mkdirp(outDir, function (err) {
    if (err) return cb(err)

    const rs = readdirp({ root: srcDir })
    const streams = []
    const createdFiles = []

    // create a new stream for every file emitted
    rs.on('data', function (file) {
      createdFiles.push(path.join(outDir, maxstache(removeUnderscore(file.path), vars)))
      streams.push(writeFile(outDir, vars, file))
    })

    // delegate errors & close streams
    eos(rs, function (err) {
      if (err) return cb(err)
      parallel(streams, function (err) {
        if (err) return cb(err)
        cb(null, createdFiles)
      })
    })
  })
}
1155491
function copyReadmeFiles() {

    const resolvedSrcReadmePaths = path.resolve(rootDir, srcReadmePaths);

    dryRun ? console.log(`In ${destDir}, this script would...`) : console.log(`In ${destDir}...`);

    fs.readdir('packages', (err, files) => {
        totalDocsCount = files.length;
    });

    createDirectory(destDir);
    glob(resolvedSrcReadmePaths, {realpath:true}, function(error, srcFiles) {
        
        srcFiles.forEach((srcReadmePath) => {    
            createDestReadme(srcReadmePath);
            const srcDirPath = path.dirname(srcReadmePath);
            const lastSrcDir = srcDirPath.split(path.sep).pop();
            sidebarEntries.push(`en/packages/${lastSrcDir}/index`);
        });

        console.log(chalk.green(`${updatedDocsCount} of ${totalDocsCount} package readme.md files updated`));
        updateSidebar();
       
    });

}
317913
function copyFiles() {
  return mergeStream(
    // CSS source
    gulp.src([
      'css-components/**/*',
      '!css-components/onsen-visual-design-spec.sketch',
      '!css-components/build/',
      '!css-components/build/**/*',
      '!css-components/node_modules/',
      '!css-components/node_modules/**/*',
      '!css-components/npm-debug.log'
    ])
      .pipe(gulp.dest('build/css-components-src/')),

    // These are not used (already loaded by gulp-replace)
    // gulp.src('core/images/**/*')
    //   .pipe(gulp.dest('build/images/')),

    // package.json (for the bindings which uses `build` directory)
    gulp.src([
      'package.json',
    ])
      .pipe(gulp.dest('build/')),

    // type definitions copy
    gulp.src('core/src/onsenui.d.ts')
      .pipe(gulp.dest('build/js/')),
  );
}
1164175
def _tar_and_copy(src_dir, target_dir):
  """"""
  src_dir = src_dir.rstrip("/")
  target_dir = target_dir.rstrip("/")
  tmp_dir = tempfile.gettempdir().rstrip("/")
  src_base = os.path.basename(src_dir)
  shell_run(
      "tar --exclude=.git -zcf {tmp_dir}/{src_base}.tar.gz -C {src_dir} .",
      src_dir=src_dir,
      src_base=src_base,
      tmp_dir=tmp_dir)
  final_destination = "%s/%s.tar.gz" % (target_dir, src_base)
  shell_run(
      ("gsutil cp {tmp_dir}/{src_base}.tar.gz "
       "{final_destination}"),
      tmp_dir=tmp_dir,
      src_base=src_base,
      final_destination=final_destination)
  return final_destination
1251098
def _copy(self, filename, id_=-1, file_type=0):
        
        if os.path.isdir(filename):
            raise JSSUnsupportedFileType(
                "Distribution Server type repos do not permit directory "
                "uploads. You are probably trying to upload a non-flat "
                "package. Please zip or create a flat package.")
        basefname = os.path.basename(filename)
        resource = open(filename, "rb")
        headers = {"DESTINATION": self.destination, "OBJECT_ID": str(id_),
                   "FILE_TYPE": file_type, "FILE_NAME": basefname}
        response = self.connection["jss"].session.post(
            url=self.connection["upload_url"], data=resource, headers=headers)
        if self.connection["jss"].verbose:
            print response
432319
def copy(self, new_path, replace=False):
        """"""
        if replace or not get_file(new_path).exists():
            self.key.copy(self.key.bucket, new_path)
            return True
        return False