Translate the file from source language to destination language.
    :param option:
    :param urlOrPaths:
    :param serverEndpoint:
    :param verbose:
    :param tikaServerJar:
    :param responseMimeType:
    :param services:
    :return:
546849
def doTranslate(option, urlOrPaths, serverEndpoint=ServerEndpoint, verbose=Verbose, tikaServerJar=TikaServerJar, 
                responseMimeType='text/plain',
                services={'all': '/translate/all'}):
    '''
    
    '''
    paths = getPaths(urlOrPaths)
    return [doTranslate1(option, path, serverEndpoint, verbose, tikaServerJar, responseMimeType, services)
            for path in paths]
231510
def cmd_http_options(server, verbose):
    
    if verbose:
        logging.basicConfig(level=logging.INFO, format='%(message)s')

    if verbose:
        print("[-] Retrieving the HTTP headers of the server...")

    options = get_options(server)

    if type(options) is dict:
        print(json.dumps(options, indent=4))
        if verbose:
            print("[+] HTTP options from {} retrieved".format(server))
    else:
        print("[X] {}".format(options), file=sys.stderr)

    return True
1348032
@Override
    public SupportedLanguagesResponse getSupportedLanguages(String endpoint) throws HttpRosetteAPIException  {
        if (DOC_ENDPOINTS.contains(endpoint) || NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) {
            return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, SupportedLanguagesResponse.class);
        } else {
            return null;
        }
    }
254202
def _translate(env, target=None, source=SCons.Environment._null, *args, **kw):
    
    if target is None: target = []
    pot = env.POTUpdate(None, source, *args, **kw)
    po = env.POUpdate(target, pot, *args, **kw)
    return po
578143
function translate(load){
			var filename;
			//!steal-remove-start
			filename = getFilename(load.name);
			//!steal-remove-end

			var result = parse(load.source, this, zoneOpts);

			// Add any import specifiers to the load.
			addImportSpecifiers(load, result);
			load.metadata.originalSource = load.source;

			// Register dynamic imports for the slim loader config
			var localLoader = loader.localLoader || loader;
			if (localLoader.slimConfig) {
				localLoader.slimConfig.needsDynamicLoader = true;

				var toMap = localLoader.slimConfig.toMap;
				Array.prototype.push.apply(toMap, result.rawImports);
				Array.prototype.push.apply(toMap, result.dynamicImports);
			}

			// For live-reload, determine if we should reload the viewModel
			hasDynamicImports = result.dynamicImports.length > 0;

			return Promise.all([
				addBundles(result.dynamicImports, load.name),
				Promise.all(result.imports)
			]).then(function(pResults){
				var exportedValuesDef = Object.keys(result.ases)
				.map(function(name){
					return "\"" + name + "\": {\n" +
					"\t\t\tenumerable: true,\n" +
					"\t\t\tconfigurable: true,\n" +
					"\t\t\twritable: true,\n" +
					"\t\t\tvalue: " + name + "['default'] || " + name + "\n" +
					"\t\t}";
				}).join(",\n");

				var output = template({
					imports: JSON.stringify(pResults[1]),
					isDevelopment: isDevelopment || false,
					routeData: result.viewModel.routeData || "",
					args: result.args.join(", "),
					zoneOpts: JSON.stringify(zoneOpts),
					intermediate: JSON.stringify(result.intermediate),
					ases: exportedValuesDef ? exportedValuesDef + "," : "",
					filename: filename
				});

				return output;
			});
		}
1006963
def interlink_translations(content):
    '''
    '''
    lang = content.lang
    # sort translations by lang
    content.translations.sort(key=attrgetter('lang'))
    for translation in content.translations:
        relpath = relpath_to_site(lang, translation.lang)
        url = _NATIVE_CONTENT_URL_DB[translation.source_path]
        translation.override_url = posixpath.join(relpath, url)
321729
def translate_url(context, language):
    
    try:
        request = context["request"]
    except KeyError:
        return ""
    view = resolve(request.path)
    current_language = translation.get_language()
    translation.activate(language)
    try:
        url = reverse(view.func, args=view.args, kwargs=view.kwargs)
    except NoReverseMatch:
        try:
            url_name = (view.url_name if not view.namespace
                        else '%s:%s' % (view.namespace, view.url_name))
            url = reverse(url_name, args=view.args, kwargs=view.kwargs)
        except NoReverseMatch:
            url_name = "admin:" + view.url_name
            url = reverse(url_name, args=view.args, kwargs=view.kwargs)
    translation.activate(current_language)
    if context['request'].META["QUERY_STRING"]:
        url += "?" + context['request'].META["QUERY_STRING"]
    return url
771275
def _translate_config_path(location):
    
    # getting spec path
    package_name, filename = resolve_asset_spec(location.strip())
    if not package_name:
        path = filename
    else:
        package = __import__(package_name)
        path = os.path.join(package_path(package), filename)

    return path
494930
def _make_request(self, params, translation_url, headers):
        
        resp = requests.get(translation_url, params=params, headers=headers)
        resp.encoding = "UTF-8-sig"
        result = resp.json()
        return result
771730
function (request, response) {
      var locale = request.params.locale;
      var sendFile = response.sendFile || response.sendfile;
      sendFile.apply(response, [path.join(configuration.directory, locale + configuration.extension)]);
    }
605826
def cli(ctx, feature_id, end, organism="", sequence=""):
    
    return ctx.gi.annotations.set_translation_end(feature_id, end, organism=organism, sequence=sequence)
951241
def metadata_and_language_from_option_line(self, line):
        """"""
        if self.start_code_re.match(line):
            self.language, self.metadata = self.options_to_metadata(self.start_code_re.findall(line)[0])
1262009
def parse(option, urlOrPaths, serverEndpoint=ServerEndpoint, verbose=Verbose, tikaServerJar=TikaServerJar, 
          responseMimeType='application/json',
          services={'meta': '/meta', 'text': '/tika', 'all': '/rmeta'}, rawResponse=False):
    '''
    
    '''
    return [parse1(option, path, serverEndpoint, verbose, tikaServerJar, responseMimeType, services)
             for path in urlOrPaths]
172157
def v2_translator(self, option):
        
        new_option = option
        new_value = getattr(self, option)

        renaming_pairs = {
            "dontfrag": "dont_fragment",
            "maxhops": "max_hops",
            "firsthop": "first_hop",
            "use_NSID": "set_nsid_bit",
            "cd": "set_cd_bit",
            "do": "set_do_bit",
            "qbuf": "include_qbuf",
            "recursion_desired": "set_rd_bit",
            "noabuf": "include_abuf"
        }
        if option in renaming_pairs.keys():
            warninglog = (
                "DeprecationWarning: {0} option has been deprecated and "
                "renamed to {1}."
            ).format(option, renaming_pairs[option])
            print(warninglog)
            new_option = renaming_pairs[option]

        # noabuf was changed to include_abuf so we need a double-negative
        if option == "noabuf":
            new_value = not new_value

        return new_option, new_value
1275686
def path_to_slug(path):
    
    from yacms.urls import PAGES_SLUG
    lang_code = translation.get_language_from_path(path)
    for prefix in (lang_code, settings.SITE_PREFIX, PAGES_SLUG):
        if prefix:
            path = path.replace(prefix, "", 1)
    return clean_slashes(path) or "/"
139221
def _translate_port(port):
    '''
    
    '''
    services = _get_services_mapping()
    if port in services and services[port]['port']:
        return services[port]['port'][0]
    return port
1302672
function (path) {
            var lang = UE.I18N[this.options.lang];
            if (!lang) {
                throw Error("not import language file");
            }
            path = (path || "").split(".");
            for (var i = 0, ci; ci = path[i++];) {
                lang = lang[ci];
                if (!lang)break;
            }
            return lang;
        }