TODO this should be an instance method
199240
public static String choose(String dictElem, String romaji) {
		dictElem = clean(dictElem);
		// simplify verbs
		// if (pos.contains("verb") && dictElem.startsWith("to ")) {
		// dictElem = dictElem.substring(3);
		// }
		// discard elements of more than 4 words
		if (isLong(dictElem)) {
			return null;
		}
		// single letters are not considered, nor excessively long items
		if (dictElem.length() > 1 && dictElem.length() < 20
				&& dictElem.length() < (romaji.length() * 3 + 5)) {
			return dictElem;
		}
		return null;
	}
1285001
def add_method(instance, method_name)
      define_singleton_method(method_name) do |*args|
        instance.public_send(method_name, *args)
      end
    end
992999
function (name, methods) {
        //this.callSuper(methods);
        this.name = name;
        this.methods = {};

        if (methods) {
            var n;
            //Add methods
            n = methods.length;
            while (n > 0) {
                n -= 1;
                this.methods[methods[n]] = true;
            }
        }
    }
703011
private CodeBlock.Builder initMethodCallCode( MapperInstance instance ) {
        CodeBlock.Builder builder = CodeBlock.builder();
        if ( null == instance.getInstanceCreationMethod().isConstructor() ) {
            builder.add( "$T.$L", rawName( instance.getMapperType() ), instance.getInstanceCreationMethod().getName() );
        } else {
            builder.add( "new $T", typeName( instance.getMapperType() ) );
        }
        return builder;
    }
180587
function(method) {
		 	if(typeof method === "function") {
				var args = [];
								
				for(var x = 1; x <= arguments.length; x++) {
					if(arguments[x]) {
						args.push(arguments[x]);
					}
				}
				
				method.apply(this, args);
			}
		}
695395
protected T createInstance() {
        try {
            Constructor<T> ctor = clazz.getDeclaredConstructor();
            ctor.setAccessible(true);
            return ctor.newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (SecurityException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
573659
public <T> void newInstance(Local<T> target, MethodId<T, Void> constructor, Local<?>... args) {
        if (target == null) {
            throw new IllegalArgumentException();
        }
        addInstruction(new ThrowingCstInsn(Rops.NEW_INSTANCE, sourcePosition,
                RegisterSpecList.EMPTY, catches, constructor.declaringType.constant));
        moveResult(target, true);
        invokeDirect(constructor, null, target, args);
    }
1298982
def context_methods
      @context.instance_methods.inject({}) do |methods, name|
        methods.merge(name.to_sym => @context.instance_method(name))
      end
    end
558890
def create_methods_from_instance(instance)
      instance.public_methods(false).each do |method_name|
        add_method(instance, method_name)
      end
    end
347596
function Method(entity, name, method, opts) {
  if (!(this instanceof Method)) return new Method(entity, name, method, opts);
  this._entity = entity;
  this._name = name;
  this._method = method;
  this._options = opts || {};
  this._chain = [];
  this.on('error', function() { /* stifle auto exit on error */ });
  debug('Creating `%s` method for `%s` entity', method, this._entity._route);
}
917593
@Override
  public MethodAmp method(String methodName, Class<?> []paramTypes)
  {
    MethodAmp method = _stubMain.method(methodName, paramTypes);
    System.out.println("MJ: " + methodName);
    return new MethodJournal(method);
    /*
                             _journal,
                             _toPeerJournal,
                             _inbox);
                             */
  }
68670
function(_instance, _static) {
  // Build the prototype.
  base2.__prototyping = this.prototype;
  var _prototype = new this;
  if (_instance) extend(_prototype, _instance);
  delete base2.__prototyping;
  
  // Create the wrapper for the constructor function.
  var _constructor = _prototype.constructor;
  function _class() {
    // Don't call the constructor function when prototyping.
    if (!base2.__prototyping) {
      if (this.constructor == arguments.callee || this.__constructing) {
        // Instantiation.
        this.__constructing = true;
        _constructor.apply(this, arguments);
        delete this.__constructing;
      } else {
        // Casting.
        return extend(arguments[0], _prototype);
      }
    }
    return this;
  };
  _prototype.constructor = _class;
  
  // Build the static interface.
  for (var i in Base) _class[i] = this[i];
  _class.ancestor = this;
  _class.base = Undefined;
  //_class.init = Undefined;
  if (_static) extend(_class, _static);
  _class.prototype = _prototype;
  if (_class.init) _class.init();
  
  // introspection (removed when packed)
  ;;; _class["#implements"] = [];
  ;;; _class["#implemented_by"] = [];
  
  return _class;
}
1133244
function(callback) {
		if (this.instance) {
			this.instance.createPage(function(page) {
				callback(page);
			});
		} else {
			var that = this;
			this._createInstance(function() {
				that.createPage(callback);
			});
		}
	}
729842
def build_leaf(object)
      this = self
      run_validator = method(:run_validator)
      check_types = method(:check_types)

      object.instance_exec do
        define_singleton_method(this.name) { this.value }
        define_singleton_method("#{this.name}=") do |value|
          run_validator.call(value)
          check_types.call(value)
          this.value = value
        end
      end

      object
    end
1121535
def method_missing(name, *args, &block)
      if self.class.resources.keys.include?(name)
        resources[name] ||= self.class.resources[name].new(self)
        resources[name]
      else
        super
      end
    end
682969
function (context, stepName, thisArg) {
    var steps = this.steps;
    var stepIndex = stepName ? steps.indexOf(stepName) : 0;
    var index = null;

    if (stepIndex === -1) {
      stepIndex = 0;
    }

    index = { stepIndex: stepIndex, flowIndex: 0 };

    this.next(thisArg, index, context || {}, null);

    return this;
  }
589070
private CodeBlock methodCallCode( MapperInstance instance ) {
        CodeBlock.Builder builder = initMethodCallCode( instance );
        return methodCallParametersCode( builder, ImmutableList.<CodeBlock>of() );
    }