Visitor method: translate a list of nodes.
353188
public <T extends JCTree> List<T> translate(List<T> trees) {
        if (trees == null) return null;
        for (List<T> l = trees; l.nonEmpty(); l = l.tail)
            l.head = translate(l.head);
        return trees;
    }
844916
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) {
    double[] offset = null;
    String vstr = ((Element) cur).getAttribute(ATTR_VECTOR);
    if(vstr != null && vstr.length() > 0) {
      offset = parseVector(vstr);
    }
    if(offset == null) {
      throw new AbortException("No translation vector given.");
    }

    // *** add new translation
    cluster.addTranslation(offset);

    // TODO: check for unknown attributes.
    XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
    while(iter.hasNext()) {
      Node child = iter.next();
      if(child.getNodeType() == Node.ELEMENT_NODE) {
        LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
      }
    }
  }
195420
void translate() {
            make.at(pos.getStartPosition());
            JCClassDecl owner = classDef((ClassSymbol)mapVar.owner);

            // synthetic static final int[] $SwitchMap$Color = new int[Color.values().length];
            MethodSymbol valuesMethod = lookupMethod(pos,
                                                     names.values,
                                                     forEnum.type,
                                                     List.nil());
            JCExpression size = make // Color.values().length
                .Select(make.App(make.QualIdent(valuesMethod)),
                        syms.lengthVar);
            JCExpression mapVarInit = make
                .NewArray(make.Type(syms.intType), List.of(size), null)
                .setType(new ArrayType(syms.intType, syms.arrayClass));

            // try { $SwitchMap$Color[red.ordinal()] = 1; } catch (java.lang.NoSuchFieldError ex) {}
            ListBuffer<JCStatement> stmts = new ListBuffer<>();
            Symbol ordinalMethod = lookupMethod(pos,
                                                names.ordinal,
                                                forEnum.type,
                                                List.nil());
            List<JCCatch> catcher = List.<JCCatch>nil()
                .prepend(make.Catch(make.VarDef(new VarSymbol(PARAMETER, names.ex,
                                                              syms.noSuchFieldErrorType,
                                                              syms.noSymbol),
                                                null),
                                    make.Block(0, List.nil())));
            for (Map.Entry<VarSymbol,Integer> e : values.entrySet()) {
                VarSymbol enumerator = e.getKey();
                Integer mappedValue = e.getValue();
                JCExpression assign = make
                    .Assign(make.Indexed(mapVar,
                                         make.App(make.Select(make.QualIdent(enumerator),
                                                              ordinalMethod))),
                            make.Literal(mappedValue))
                    .setType(syms.intType);
                JCStatement exec = make.Exec(assign);
                JCStatement _try = make.Try(make.Block(0, List.of(exec)), catcher, null);
                stmts.append(_try);
            }

            owner.defs = owner.defs
                .prepend(make.Block(STATIC, stmts.toList()))
                .prepend(make.VarDef(mapVar, mapVarInit));
        }
610071
def extract_translations(self, string):
        """"""

        tree = ast.parse(string)
        # ast_visit(tree)
        visitor = TransVisitor(
            self.tranz_functions,
            self.tranzchoice_functions)
        visitor.visit(tree)

        return visitor.translations
738745
public List<JCAnnotation> translateAnnotations(List<JCAnnotation> trees) {
        for (List<JCAnnotation> l = trees; l.nonEmpty(); l = l.tail)
            l.head = translate(l.head);
        return trees;
    }
263528
def _visit_for(self, cls, node, parent):
        """"""
        newnode = cls(node.lineno, node.col_offset, parent)
        type_annotation = self.check_type_comment(node)
        newnode.postinit(
            target=self.visit(node.target, newnode),
            iter=self.visit(node.iter, newnode),
            body=[self.visit(child, newnode) for child in node.body],
            orelse=[self.visit(child, newnode) for child in node.orelse],
            type_annotation=type_annotation,
        )
        return newnode
1151567
def translate(patterns, *, flags=0):
    """"""

    flags = _flag_transform(flags)
    return _wcparse.translate(_wcparse.split(patterns, flags), flags)
661041
def translate_labels(val):
    '''
    
    '''
    if not isinstance(val, dict):
        if not isinstance(val, list):
            val = split(val)
        new_val = {}
        for item in val:
            if isinstance(item, dict):
                if len(item) != 1:
                    raise SaltInvocationError('Invalid label(s)')
                key = next(iter(item))
                val = item[key]
            else:
                try:
                    key, val = split(item, '=', 1)
                except ValueError:
                    key = item
                    val = ''
            if not isinstance(key, six.string_types):
                key = six.text_type(key)
            if not isinstance(val, six.string_types):
                val = six.text_type(val)
            new_val[key] = val
        val = new_val
    return val
596126
public <T extends JCTree> List<T> translate(List<T> trees, Type pt) {
        Type prevPt = this.pt;
        List<T> res;
        try {
            this.pt = pt;
            res = translate(trees);
        } finally {
            this.pt = prevPt;
        }
        return res;
    }
360884
public List<JCVariableDecl> translateVarDefs(List<JCVariableDecl> trees) {
        for (List<JCVariableDecl> l = trees; l.nonEmpty(); l = l.tail)
            l.head = translate(l.head);
        return trees;
    }
91437
public function onTranslationList()
    {
        $this->breadcrumbs->register('translations', function($breadcrumbs) {
            $breadcrumbs->push('Translations', handles('antares::translations/index/' . area()));
        });

        $this->shareOnView('translations');
    }
1361566
def make_translations(unique_name, node):
    '''
    
    '''
    introspectable = not node.attrib.get('introspectable') == '0'

    if node.tag == core_ns('member'):
        __TRANSLATED_NAMES['c'][unique_name] = unique_name
        if introspectable:
            components = get_gi_name_components(node)
            components[-1] = components[-1].upper()
            gi_name = '.'.join(components)
            __TRANSLATED_NAMES['python'][unique_name] = gi_name
            __TRANSLATED_NAMES['javascript'][unique_name] = gi_name
    elif c_ns('identifier') in node.attrib:
        __TRANSLATED_NAMES['c'][unique_name] = unique_name
        if introspectable:
            components = get_gi_name_components(node)
            gi_name = '.'.join(components)
            __TRANSLATED_NAMES['python'][unique_name] = gi_name
            components[-1] = 'prototype.%s' % components[-1]
            __TRANSLATED_NAMES['javascript'][unique_name] = '.'.join(components)
    elif c_ns('type') in node.attrib:
        components = get_gi_name_components(node)
        gi_name = '.'.join(components)
        __TRANSLATED_NAMES['c'][unique_name] = unique_name
        if introspectable:
            __TRANSLATED_NAMES['javascript'][unique_name] = gi_name
            __TRANSLATED_NAMES['python'][unique_name] = gi_name
    elif node.tag == core_ns('field'):
        components = []
        get_field_c_name_components(node, components)
        display_name = '.'.join(components[1:])
        __TRANSLATED_NAMES['c'][unique_name] = display_name
        if introspectable:
            __TRANSLATED_NAMES['javascript'][unique_name] = display_name
            __TRANSLATED_NAMES['python'][unique_name] = display_name
    elif node.tag == core_ns('virtual-method'):
        display_name = node.attrib['name']
        __TRANSLATED_NAMES['c'][unique_name] = display_name
        if introspectable:
            __TRANSLATED_NAMES['javascript'][unique_name] = 'vfunc_%s' % display_name
            __TRANSLATED_NAMES['python'][unique_name] = 'do_%s' % display_name
    elif node.tag == core_ns('property'):
        display_name = node.attrib['name']
        __TRANSLATED_NAMES['c'][unique_name] = display_name
        if introspectable:
            __TRANSLATED_NAMES['javascript'][unique_name] = display_name
            __TRANSLATED_NAMES['python'][unique_name] = display_name.replace('-', '_')
    else:
        __TRANSLATED_NAMES['c'][unique_name] = node.attrib.get('name')
        if introspectable:
            __TRANSLATED_NAMES['python'][unique_name] = node.attrib.get('name')
            __TRANSLATED_NAMES['javascript'][unique_name] = node.attrib.get('name')
518603
def _handle_nodes(nodes: MaybeNodeList) -> List[BaseEntity]:
    """"""
    if isinstance(nodes, BaseEntity):
        return [nodes]

    return [
        (
            parse_result_to_dsl(node)
            if not isinstance(node, BaseEntity) else
            node
        )
        for node in nodes
    ]
1136419
def generic_visit(self, node, iter_fields=ast.iter_fields, AST=ast.AST):
        
        for field, value in iter_fields(node):
            if isinstance(value, list):
                for item in value:
                    if isinstance(item, AST):
                        self.visit(item)
            elif isinstance(value, AST):
                self.visit(value)
397428
public List<JCCase> translateCases(List<JCCase> trees) {
        for (List<JCCase> l = trees; l.nonEmpty(); l = l.tail)
            l.head = translate(l.head);
        return trees;
    }
645470
def visit_Import(self, node):
        """"""
        self.imports.extend((None, n.name, n.asname, None)
                            for n in node.names)
        ast.NodeVisitor.generic_visit(self, node)
584503
def translate(src, dest, word):
	'''  '''

	results = []

	try:
		from textblob import TextBlob
		results.append(TextBlob(word).translate(from_lang = src, to = dest).string)
	except ImportError:
		pass

	if not results:
		return [None]
	return results