Write the Facades to the appropriate _client<version>.py
191255
def write_facades(captures, options):
    
    for version in sorted(captures.keys()):
        filename = "{}/_client{}.py".format(options.output_dir, version)
        with open(filename, "w") as f:
            f.write(HEADER)
            f.write("from juju.client.facade import Type, ReturnMapping\n")
            f.write("from juju.client._definitions import *\n\n")
            for key in sorted(
                    [k for k in captures[version].keys() if "Facade" in k]):
                print(captures[version][key], file=f)

    # Return the last (most recent) version for use in other routines.
    return version
1062677
function generateVersionsTooltip(versions) {
    return versions.map(function(lib) {
      return lib.name + " " + lib.version;
    }).join("\n");
  }
90251
def create(client, output_file, revision, paths):
    """"""
    graph = Graph(client)
    outputs = graph.build(paths=paths, revision=revision)

    output_file.write(
        yaml.dump(
            ascwl(
                graph.ascwl(outputs=outputs),
                filter=lambda _, x: x is not None and x != [],
                basedir=os.path.dirname(getattr(output_file, 'name', '.')) or
                '.',
            ),
            default_flow_style=False
        )
    )
1322393
function (res, name, version) {
  //Options
  var imgPath, width;
  //RegExp
  var re = /^\d\.\d.\d$/;
  //Test version
  if (re.test(version)) {
    imgPath = path.join(dir, name + '.png');
    width = 76;
  } else if (version.length === 6) {
    imgPath = path.join(dir, name + '-larger.png');
    width = 80;
  } else if (version.length === 7) {
    imgPath = path.join(dir, name + '-larger.png');
    width = 77;
  } else {
    imgPath = path.join(dir, name + '-larger.png');
    width = 74;
  }

  //Create Image
  var base = gm(imgPath)
    .font(path.join(__dirname, 'fonts', 'Arial.ttf'))
    .fontSize(10)
    .fill('#ffffff')
    .drawText(width, 12, version);
  //Write Stream and send to client
  write(base, res);
}
802777
def version():
    
    click.echo(
        click.style(
            "F.A.B Version: {0}.".format(current_app.appbuilder.version),
            bg="blue",
            fg="white"
        )
    )
20665
async function writeCustomPropertiesToCjsFile(to, customProperties) {
	const jsContents = Object.keys(customProperties).reduce((jsLines, name) => {
		jsLines.push(`\t\t'${escapeForJS(name)}': '${escapeForJS(customProperties[name])}'`);

		return jsLines;
	}, []).join(',\n');
	const js = `module.exports = {\n\tcustomProperties: {\n${jsContents}\n\t}\n};\n`;

	await writeFile(to, js);
}
96950
protected function writeVersionInfo()
    {
        if (PHP_SAPI !== 'cli') {
            return;
        }

        try {
            $client = $this->config->getChecker();
            if (!$client->isLatest()) {
                $this->output->writeln(\sprintf('New version is available (current: %s, latest: %s)', self::VERSION, $client->getLatest()));
            }
        } catch (\InvalidArgumentException $e) {
            $this->output->writeln($e->getMessage());
        }
    }
344793
def WriteBuildYaml(self, fd, build_timestamp=True):
    """"""
    output = {
        "Client.build_environment":
            rdf_client.Uname.FromCurrentSystem().signature(),
        "Template.build_type":
            config.CONFIG.Get("ClientBuilder.build_type", context=self.context),
        "Template.version_major":
            config.CONFIG.Get("Source.version_major", context=self.context),
        "Template.version_minor":
            config.CONFIG.Get("Source.version_minor", context=self.context),
        "Template.version_revision":
            config.CONFIG.Get("Source.version_revision", context=self.context),
        "Template.version_release":
            config.CONFIG.Get("Source.version_release", context=self.context),
        "Template.arch":
            config.CONFIG.Get("Client.arch", context=self.context)
    }

    if build_timestamp:
      output["Client.build_time"] = rdfvalue.RDFDatetime.Now()
    else:
      self.REQUIRED_BUILD_YAML_KEYS.remove("Client.build_time")

    for key, value in iteritems(output):
      output[key] = str(value)

    output["Template.build_context"] = self.context

    output_keys = set(iterkeys(output))
    if output_keys != self.REQUIRED_BUILD_YAML_KEYS:
      raise RuntimeError("Bad build.yaml: expected %s, got %s" %
                         (self.REQUIRED_BUILD_YAML_KEYS, output_keys))
    fd.write(yaml.Dump(output).encode("utf-8"))
786472
def generate_py():
    """"""
    model = {}

    vk = init()
    format_vk(vk)
    model_alias(vk, model)
    model_typedefs(vk, model)
    model_enums(vk, model)
    model_macros(vk, model)
    model_funcpointers(vk, model)
    model_exceptions(vk, model)
    model_constructors(vk, model)
    model_functions(vk, model)
    model_ext_functions(vk, model)

    env = jinja2.Environment(
        autoescape=False,
        trim_blocks=True,
        lstrip_blocks=True,
        loader=jinja2.FileSystemLoader(HERE)
    )

    out_file = path.join(HERE, path.pardir, 'vulkan', '_vulkan.py')
    with open(out_file, 'w') as out:
        out.write(env.get_template('vulkan.template.py').render(model=model))
1271653
function writePackageVersion(newVersion) {
  var packageJson = path.join(process.cwd(), 'package.json'),
    raw = require(packageJson);

  raw.version = newVersion;

  fs.writeFileSync(packageJson, JSON.stringify(raw, null, 2));
}
1109192
def set_version(version):
    

    with open(FILENAME) as pythonfile:
        content = pythonfile.read()

    output = re.sub(RE_VERSION, r"\1'{}'".format(version), content)

    if content == output:
        error('failed updating {}'.format(FILENAME))

    with open(FILENAME, 'w') as pythonfile:
        pythonfile.write(output)
944214
def _add_versions(samples):
    
    samples[0]["versions"] = {"tools": programs.write_versions(samples[0]["dirs"], samples[0]["config"]),
                              "data": provenancedata.write_versions(samples[0]["dirs"], samples)}
    return samples
1104189
async def set_version(self, tp, params, version=None, elem=None):
        
        self.registry.set_tr(None)
        tw = TypeWrapper(tp, params)
        if not tw.is_versioned():
            return TypeWrapper.ELEMENTARY_RES

        # If not in the DB, store to the archive at the current position
        if not self.version_db.is_versioned(tw):
            if version is None:
                version = self._cur_version(tw, elem)

            await dump_uvarint(self.iobj, 0)
            await dump_uvarint(self.iobj, version)
            self.version_db.set_version(tw, 0, version)

        return self.version_db.get_version(tw)[1]
330999
def package_version():
    """"""
    version_path = os.path.join(os.path.dirname(__file__), 'version.py')

    version = read_version(version_path)
    write_version(version_path, version)

    return version
1228950
def _build_client(self, name=None):
        
        url_path = self._url_path + [name] if name else self._url_path
        return Client(host=self.host,
                      version=self._version,
                      request_headers=self.request_headers,
                      url_path=url_path,
                      append_slash=self.append_slash,
                      timeout=self.timeout)
398969
def handle_versions(repo, **kwargs):
    """"""
    log.info('versions: %s %s' %(repo, kwargs))
    if not hasattr(repo, 'versions'):
        return []
    return [v.serialize() for v in repo.versions(**kwargs)]
585149
def obsolete_client(func):
    """"""

    @functools.wraps(func)
    def new_func(*args, **kwargs):
        raise ObsoleteException(
            "{} has been removed from this version of the library. "
            "Please refer to current documentation for guidance."
            .format(func.__name__)
        )

    return new_func