Converts Process to ExportedOpenFile.
552149
def Convert(self, metadata, process, token=None):
    """"""

    for f in process.open_files:
      yield ExportedOpenFile(metadata=metadata, pid=process.pid, path=f)
408938
def export(self, location):
        """"""
        temp_dir = tempfile.mkdtemp('-export', 'pip-')
        self.unpack(temp_dir)
        if os.path.exists(location):
            # Remove the location to make sure Bazaar can export it correctly
            rmtree(location)
        try:
            call_subprocess([self.cmd, 'export', location], cwd=temp_dir,
                            filter_stdout=self._filter, show_stdout=False)
        finally:
            rmtree(temp_dir)
550912
public InputStream export(Context context,
                              String pid,
                              String format,
                              String exportContext,
                              String encoding) throws ServerException {
        return delegate.export(context, pid, format, exportContext, encoding);
    }
68114
def convert(self, blob, **kw):
        """"""
        timeout = self.run_timeout
        with make_temp_file(blob) as in_fn, make_temp_file(
            prefix="tmp-unoconv-", suffix=".pdf"
        ) as out_fn:

            args = ["-f", "pdf", "-o", out_fn, in_fn]
            # Hack for my Mac, FIXME later
            if Path("/Applications/LibreOffice.app/Contents/program/python").exists():
                cmd = [
                    "/Applications/LibreOffice.app/Contents/program/python",
                    "/usr/local/bin/unoconv",
                ] + args
            else:
                cmd = [self.unoconv] + args

            def run_uno():
                try:
                    self._process = subprocess.Popen(
                        cmd, close_fds=True, cwd=bytes(self.tmp_dir)
                    )
                    self._process.communicate()
                except Exception as e:
                    logger.error("run_uno error: %s", bytes(e), exc_info=True)
                    raise ConversionError("unoconv failed") from e

            run_thread = threading.Thread(target=run_uno)
            run_thread.start()
            run_thread.join(timeout)

            try:
                if run_thread.is_alive():
                    # timeout reached
                    self._process.terminate()
                    if self._process.poll() is not None:
                        try:
                            self._process.kill()
                        except OSError:
                            logger.warning("Failed to kill process %s", self._process)

                    self._process = None
                    raise ConversionError(f"Conversion timeout ({timeout})")

                converted = open(out_fn).read()
                return converted
            finally:
                self._process = None
1099801
def export(outfile, pk):
    """"""
    load_dbenv_if_not_loaded(
    )  # Important to load the dbenv in the last moment

    from aiida.orm import load_node
    node = load_node(pk)
    string = str(node)

    if outfile:
        with open(outfile, 'w') as f:
            f.write(string)
    else:
        click.echo(string)
506920
def export_obo(path_to_file, connection=None):
    
    db = DbManager(connection)
    db.export_obo(path_to_export_file=path_to_file)
    db.session.close()
996272
def openfile(filename, mode="rt", *args, expanduser=False, expandvars=False,
             makedirs=False, **kwargs):
    """"""
    if filename in ("-", None):
        return sys.stdin if "r" in mode else sys.stdout
    if expanduser:
        filename = os.path.expanduser(filename)
    if expandvars:
        filename = os.path.expandvars(filename)
    if makedirs and ("a" in mode or "w" in mode):
        parentdir = os.path.dirname(filename)
        if not os.path.isdir(parentdir):
            os.makedirs(parentdir)
    if filename.endswith(".gz"):
        if gzip is None:
            raise NotImplementedError
        _open = gzip.open
    elif filename.endswith(".bz2"):
        if bz2 is None:
            raise NotImplementedError
        _open = bz2.open
    elif filename.endswith(".xz") or filename.endswith(".lzma"):
        if lzma is None:
            raise NotImplementedError
        _open = lzma.open
    else:
        _open = open
    return _open(filename, mode, *args, **kwargs)
700825
def convert_to_file(cgi_input, output_file, twobit_ref, twobit_name, var_only=False):
    """"""

    if isinstance(output_file, str):
        output_file = auto_zip_open(output_file, 'w')

    conversion = convert(cgi_input=cgi_input, twobit_ref=twobit_ref, twobit_name=twobit_name, var_only=var_only)
    for line in conversion:
        output_file.write(line + "\n")
    output_file.close()
840124
function openFile(file) {
      var edit;
      if (!editor || gui) {
        open(file);
      } else {
        edit = spawn(editor, [file], {stdio: 'inherit'});
        edit.on('exit', process.exit);
      }
    }
222089
public void toFile(Path path, OpenOption... options) throws IOException {
        Files.write(path, pBytes, options);

    }
368749
function processFile(idx, count, filename, data, parsedDeclarations, pluggable) {
  const declarations = parsedDeclarations.files[filename];
  // Inject dependent declaration extraction to last file
  const dependentDeclarations = idx === count - 1 ? parsedDeclarations.dependentDeclarations : [];
  const variables = { global: {} };

  const globalDeclarationResultHandler = (declaration, value, sassValue) => {
    if(!variables.global[declaration.declaration]) {
      variables.global[declaration.declaration] = [];
    }
    const variableValue = pluggable.run(Pluggable.POST_VALUE, { value, sassValue }).value;
    variables.global[declaration.declaration].push({ declaration, value: variableValue });
  }

  const fileId = getFileId(filename);
  const injection = injectExtractionFunctions(fileId, declarations, dependentDeclarations, { globalDeclarationResultHandler });
  const injectedData = `${data}\n\n${injection.injectedData}`;
  const injectedFunctions = injection.injectedFunctions;

  return {
    fileId,
    declarations,
    variables,
    injectedData,
    injectedFunctions,
  };
}
1275513
def convert(data)
      Open3.popen3(command) do |stdin, stdout, stderr| 
        stdin.puts(data)
        stdin.close
        output = stdout.read
        error = stderr.read
        raise ConversionError, error unless error.empty?
        return output.strip
      end
    rescue Errno::ENOENT
      raise NoExecutableError, "Can't find the '#{executable}' executable."
    end
260758
def export_handle(self, directory):
        """"""
        filename = getattr(self, 'filename')
        dest_file = "%s/%s" % (directory, filename)
        dest_dir = os.path.dirname(dest_file)
        if not os.path.isdir(dest_dir):
            os.mkdir(dest_dir, 0o700)

        return open(dest_file, 'w')
1327150
def save_file(data, export_file):
    """"""
    create_dir(os.path.dirname(export_file))

    try:
        with open(export_file, "w") as file:
            file.write(data)
    except PermissionError:
        logging.warning("Couldn't write to %s.", export_file)
981475
def export_project(self):
        
        generated_projects = deepcopy(self.generated_projects)
        self.process_data_for_makefile(self.workspace)
        generated_projects['path'], generated_projects['files']['makefile'] = self.gen_file_jinja('makefile_armcc.tmpl', self.workspace, 'Makefile', self.workspace['output_dir']['path'])
        return generated_projects
1012140
def rpc_export(rpc_method_name, sync=False):
    """"""
    def dec(f):
        f._nvim_rpc_method_name = rpc_method_name
        f._nvim_rpc_sync = sync
        f._nvim_bind = True
        f._nvim_prefix_plugin_path = False
        return f
    return dec
1002981
def outfile(self):
        """"""
        return os.path.join(OPTIONS['base_dir'],
                            '{0}.{1}'.format(self.name, OPTIONS['out_ext']))