Create a new MAR file.
344377
def do_create(marfile, files, compress, productversion=None, channel=None,
              signing_key=None, signing_algorithm=None):
    """"""
    with open(marfile, 'w+b') as f:
        with MarWriter(f, productversion=productversion, channel=channel,
                       signing_key=signing_key,
                       signing_algorithm=signing_algorithm,
                       ) as m:
            for f in files:
                m.add(f, compress=compress)
953557
function (file) {
    return new File({
      pattern: this.pattern,
      recurse: this.recurse,
      dirname: file.dirname,
      segment: file.segment,
      path: file.path
    });
  }
499393
def create(cls, ltfile):
        """"""

        if not re.search('\.txt?', ltfile) is None:
            files = np.loadtxt(ltfile, unpack=True, dtype='str')
        elif not isinstance(ltfile, list):
            files = glob.glob(ltfile)

        ltc = cls.create_from_fits(files[0])
        for f in files[1:]:
            ltc.load_ltfile(f)

        return ltc
887012
def create(resource_path, previous_version=None, package='perch.migrations'):
    """"""
    pkg, obj = resource_path.rsplit('.', 1)
    module = importlib.import_module(pkg)
    resource = getattr(module, obj)
    version = uuid4().hex
    target_module = importlib.import_module(package)
    target_dir = os.path.dirname(target_module.__file__)
    target_file = os.path.join(target_dir, resource.resource_type + '_' + version + '.py')

    with open(target_file, 'w') as f:
        f.write(MIGRATION_TEMPLATE.format(
            resource_path=resource_path,
            resource_type=resource.resource_type,
            version=version,
            previous_version=previous_version or '',
        ))

    return target_file
197274
def create_arj (archive, compression, cmd, verbosity, interactive, filenames):
    """"""
    cmdlist = [cmd, 'a', '-r']
    if not interactive:
        cmdlist.append('-y')
    cmdlist.append(archive)
    cmdlist.extend(filenames)
    return cmdlist
359961
def new_output_file(filename = 'foo')
      File.new( File.expand_path(File.join(export_path, filename)), 'w+')
    end
965799
private void createNewLocalFile(File newFile) throws CmsException {

        if (newFile.exists()) {
            throw new CmsSynchronizeException(
                Messages.get().container(Messages.ERR_EXISTENT_FILE_1, newFile.getPath()));
        }
        FileOutputStream fOut = null;
        try {
            File parentFolder = new File(
                newFile.getPath().replace('/', File.separatorChar).substring(
                    0,
                    newFile.getPath().lastIndexOf(File.separator)));
            parentFolder.mkdirs();
            if (parentFolder.exists()) {
                fOut = new FileOutputStream(newFile);
            } else {
                throw new CmsSynchronizeException(
                    Messages.get().container(Messages.ERR_CREATE_DIR_1, newFile.getPath()));
            }
        } catch (IOException e) {
            throw new CmsSynchronizeException(
                Messages.get().container(Messages.ERR_CREATE_FILE_1, this.getClass().getName(), newFile.getPath()),
                e);
        } finally {
            if (fOut != null) {
                try {
                    fOut.close();
                } catch (IOException e) {
                    // ignore
                }
            }
        }
    }
1211310
def _create_sample_file(data, out_dir):
    """"""
    sample_file = os.path.join(out_dir, "sample_file.txt")
    with open(sample_file, 'w') as outh:
        for sample in data:
            outh.write(sample[0]["clean_fastq"] + "\n")
    return sample_file
760644
function createFiles (num, dir) {
  for (var i = 0; i < num; i++) {
    grunt.file.write(path.join(dir, 'test-' + i + '.js'), 'var test = ' + i + ';');
  }
}
485822
def create_non_data_file(self, params, file_data):
        '''
        
        '''
        api_prefix = '/api/imports2/'

        if not params.get('method', None):
            params['method'] = 'blob'

        return self._perform_request("post", api_prefix, params=params, files=file_data)
918348
def new(item, total)
        data = read_file
        data[item] = {'total' => total.to_i, 'min' => options[:minimum].to_i, 'url' => options[:url] || read_config['url'], 'checked' => Time.now}
        write_file(data)
    end
1067828
def _create_file(self, filename):
        """"""
        file_descriptor = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL)
        return os.fdopen(file_descriptor, 'w')
1017448
def createdb():
    """"""
    manager.db.engine.echo = True
    manager.db.create_all()
    set_alembic_revision()
489112
def createCorrFile(outfile, arrlist, template):
    
    # Remove the existing cor file if it exists
    if os.path.isfile(outfile):
        os.remove(outfile)
        print("Removing old corr file: '{:s}'".format(outfile))

    with fits.open(template, memmap=False) as ftemplate:
        for arr in arrlist:
            ftemplate[arr['sciext']].data = arr['corrFile']
            if arr['dqext'][0] != arr['sciext'][0]:
                ftemplate[arr['dqext']].data = arr['dqMask']
        ftemplate.writeto(outfile)
        print("Created CR corrected file: '{:s}'".format(outfile))
1087616
def create(self):
        """"""
        self.buffer = []
        self.buf_count = 0
        if not self.directory.exists: self.directory.create()
        self.open('w')
        return self
851693
function createFile(file) {
    fs.ensureFileSync(file.name);
    fs.writeFileSync(file.name, file.source);
    return;
}
448184
def create(self):
        """"""
        self._storage_broker.create_structure()
        self._storage_broker.put_admin_metadata(self._admin_metadata)