translate one method, which means the method itself and all blocks inside it
 returns an array of assemblers
501875
def translate_method( method_compiler , translator)
      all = []
      all << translate_cpu( method_compiler , translator )
      method_compiler.block_compilers.each do |block_compiler|
        all << translate_cpu(block_compiler , translator)
      end
      all
    end
722533
function methodToAbi (method) {
  const length = method.length;
  const typesStart = method.indexOf('(');
  const typesEnd = method.indexOf(')');

  if (typesStart === -1) {
    throw new Error(`Missing start ( in call to decodeMethod with ${method}`);
  } else if (typesEnd === -1) {
    throw new Error(`Missing end ) in call to decodeMethod with ${method}`);
  } else if (typesEnd < typesStart) {
    throw new Error(`End ) is before start ( in call to decodeMethod with ${method}`);
  } else if (typesEnd !== length - 1) {
    throw new Error(`Extra characters after end ) in call to decodeMethod with ${method}`);
  }

  const name = method.substr(0, typesStart);
  const types = method.substr(typesStart + 1, length - (typesStart + 1) - 1).split(',');
  const inputs = types.filter((_type) => _type.length).map((_type) => {
    const type = fromParamType(toParamType(_type));

    return { type };
  });

  return { type: 'function', name, inputs };
}
1000224
def translate( instruction )
      class_name = instruction.class.name.split("::").last
      self.send( "translate_#{class_name}".to_sym , instruction)
    end
78399
function wrapMutatingArrayMethod(method, func) {
      return function() {
        var result = [][method].apply(obj, arguments);
        this.len = this.values.length;
        cache = {};
        children = {};
        func.apply(this, arguments);
        target.parent.trigger('update', target.prop);
        return result;
      };
    }
1337674
function _callMethod( $elem, method ) {
        if ( methods[ method ] !== undefined ) {
            return methods[ method ].apply( $elem, sliceArray.call( arguments, 2 ) );
        }

        return $elem;
    }
561832
def method_missing(key, *args, &block)
      if key.to_s =~ /\A(.+)=\z/
        self[$1] = args.first
        return args.first
      end
      if key.to_s =~ /\A(.+)\?\z/
        return !!self[$1]
      end
      return self[key]  if has_key?(key)
      nil
    end
1278713
function translateTemplates(templates) {
    var result = [];
    for (var _i = 0, templates_1 = templates; _i < templates_1.length; _i++) {
        var temp = templates_1[_i];
        var col = {};
        var props = Object.getOwnPropertyNames(temp);
        for (var _a = 0, props_1 = props; _a < props_1.length; _a++) {
            var prop = props_1[_a];
            col[prop] = temp[prop];
        }
        if (temp.headerTemplate) {
            col.headerTemplate = temp.headerTemplate;
        }
        if (temp.cellTemplate) {
            col.cellTemplate = temp.cellTemplate;
        }
        if (temp.summaryFunc) {
            col.summaryFunc = temp.summaryFunc;
        }
        if (temp.summaryTemplate) {
            col.summaryTemplate = temp.summaryTemplate;
        }
        result.push(col);
    }
    return result;
}
1051029
def _translate_stm(self, oprnd1, oprnd2, oprnd3):
        
        assert oprnd1.size and oprnd3.size
        assert oprnd3.size == self._address_size

        op1_var = self._translate_src_oprnd(oprnd1)
        op3_var = self._translate_src_oprnd(oprnd3)

        for i in range(0, oprnd1.size, 8):
            self._mem_curr[op3_var + i//8] = smtfunction.extract(op1_var, i, 8)

        # Memory versioning.
        self._mem_instance += 1

        mem_old = self._mem_curr
        mem_new = self.make_array(self._address_size, "MEM_{}".format(self._mem_instance))

        self._mem_curr = mem_new

        return [mem_new == mem_old]
54028
function getAlternateTypes(method) {
          var types = [];

          function process(arr) {
            if (arr) {
              arr.forEach(function(obj) {
                if (obj.type) {
                  var split = obj.type.split('|');
                  if (split.length > 1) {
                    types = types.concat(split);
                  }
                }
              });
            }
          }

          process(method.params);
          process(method.options);

          return types;
        }
329508
def method_missing(meth, *args, &block)
      if args.empty? && !block_given? && (match = /\Ato_(\w+)\Z/.match(meth.to_s))
        begin
          convert_to(match[1])
        rescue ExpressionError
          super(meth, *args, &block)
        end
      else
        super(meth, *args, &block)
      end
    end
218225
function() {
        this.io = µBlock.CompiledLineIO;
        this.blockId = undefined;
        this.block = undefined;
        this.stringifier = this.io.serialize;
        this.blocks = new Map();
        this.properties = new Map();
    }
1167830
def cpu_init_init
      init = assemblers.find {|asm| asm.callable.name == :__init__}
      risc_init = Branch.new( "__initial_branch__" , init.callable.binary )
      @platform.translator.translate(risc_init)
    end
3341
def create_memoized_method
      name, method, freezer = @method_name, @original_method, @freezer
      @descendant.module_eval do
        define_method(name) do |&block|
          fail BlockNotAllowedError.new(self.class, name) if block
          memoized_method_cache.fetch(name) do
            freezer.call(method.bind(self).call)
          end
        end
      end
    end
815751
function unpackMethodSets(methods) {
    var result = [];

    methods.forEach(function(method) {
      if (method.set) {
        method.set.forEach(function(name) {
          var setMethod = clone(method);
          setMethod.name = name;
          result.push(setMethod);
        });
      } else {
        result.push(method);
      }
    });
    return result;
  }
774241
def method_missing(m, *args, &block)
      if m.to_s =~ /^with_(.+)$/
        with($1.to_sym => args.first)
        self
      else
        super
      end
    end
518058
def translate(self):
        
        expressions = []
        varnames = set()
        funcnames = set()
        for part in self.parts:
            if isinstance(part, str):
                expressions.append(ex_literal(part))
            else:
                e, v, f = part.translate()
                expressions.extend(e)
                varnames.update(v)
                funcnames.update(f)
        return expressions, varnames, funcnames
197464
def assembler_names
      a = []
      @assemblers.each do |t|
        a << t.name
        a << t.shortname if t.shortname
      end
      a
    end