add a method to a typename; used to define the methods that can be callefd on an AS proxied object
334506
function(ty, methodName)
    {
        ty[methodName] = function()
        {
            return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id, methodName, FABridge.argsToArray(arguments)));
        }
    }
1328722
def add_method(self, m, **kwargs):
        
        if isinstance(m, types.FunctionType):
            self['function', id(m)] = m
        else:
            f, obj = get_method_vars(m)
            wrkey = (f, id(obj))
            self[wrkey] = obj
423334
def add(self, name, extends, **kwargs):
        
        f = extends
        self._push(name=name,
                   module_=f.__module__,
                   class_=f.__name__,
                   method_=f.__name__,
                   is_class_=False,
                   **kwargs)
685325
function makeProxy(definition, names, send, rootDefinition) {
    if (! names) throw new Error("No name proxying definition " + JSON.stringify(definition));
    if (! Array.isArray(names)) names = [ names ];

    /* All definitions are objects! */
    if (typeof(definition) !== 'object') {
      throw new Error("Wrong proxy definition at " + names.join('.') + " for \n"
                    + JSON.stringify(rootDefinition, null, 1));
    }

    /* Initial object */
    var object = {};

    /* Function definitions, can be also at top level */
    if (definition['!$invocable$!'] === true) {
      var clone = names.slice(0);

      /* Can be called as "new F()" or "f()" */
      var Invocable = function() {

        /* Prepare our message */
        var message = { proxy: { proxy: clone, arguments: arguments }};

        /* Is this "new F()" or a normal call? */
        if (this instanceof Invocable) {
          message.newInstance = true;
          ProxyPromise.call(this, message, send);
          this.asProxy(true);
        } else {
          return new ProxyPromise(message, send);
        }
      }

      /* Functions can have members, so keep processing */
      object = Invocable;

    }

    /* Clone all the members of the definition */
    for (var i in definition) {
      (function(i) {
        var child = definition[i];
        var clone = names.slice(0);
        clone.push(i);

        /* Basic properties for the object to define */
        var props = { enumerable: true, configurable: false };

        /* Function definitions */
        if (child['!$invocable$!'] === true) {
          props.value = makeProxy(child, clone, send, rootDefinition);
        }

        /* Setters/getters definitions */
        else if (child.hasOwnProperty('!$value$!')) {
          var initialValue = child['!$value$!'];
          props['get'] = function() {
            var message = { proxy: { proxy: clone } };
            var promise = new ProxyPromise(message, send, initialValue);
            promise.asProxy = function() { return promise } // already a proxy
            promise.then(function(success) { initialValue = success });
            return promise; // return the original ProxyPromise instance
          };
          props['set'] = function(value) {
            initialValue = value;
            send({ proxy: { value: value, proxy: clone } })
              .then(function(success) { initialValue = success });
          };
        }

        /* Nested definitions get recursively processed */
        else if (typeof(child) === 'object') {
          props.value = makeProxy(child, clone, send, rootDefinition);
        }

        else if (i !== '!$invocable$!') {
          throw new Error("Wrong proxy definition at " + names.join('.') + "." + i + " for \n"
                        + JSON.stringify(rootDefinition, null, 1));
        }

        /* Define the properties for this */
        Object.defineProperty(object, i, props);
      })(i);
    }

    /* All done, return our object clone */
    return object;
  }
975940
def add_handler(self, f):
        
        if f.__name__.startswith('rpc_'):
            raise ValueError("Server method names cannot start with rpc_.")
        self._json_rpc_methods[f.__name__] = f
        return f
843470
function apply_methods(Class, methods, descriptor) {
           Object.keys(descriptor).forEach(function (method) {
               methods[method] = descriptor[method];

               if (typeof(descriptor[method]) !== "function") {
                   throw new TypeError(
                       "extend: Method `" + method + "` is not a function"
                   );
               }

               Object.defineProperty(Class.prototype, method, {
                   "configurable" : true,
                   "value" : descriptor[method]
               });
           });
       }
51737
def enhance_method(method, callbacks)
      _method = (PREFIX + method.to_s).to_sym
      alias_method _method, method

      self.send(:define_method, method) do |*args, &blk|
        [callbacks, _method].flatten.each do |callback|
          break unless self.send(callback, *args, &blk)
        end
      end
    end
1365725
def add_method_model(self,
                         func,  # type: Callable
                         name=None,  # type: Optional[str]
                         description=None,  # type: Optional[str]
                         ):
        # type: (...) -> MethodModel
        """"""
        return self._field_registry.add_method_model(
            func, name, description, self._part)
894821
def add_method(self, loop, callback):
        
        f, obj = get_method_vars(callback)
        wrkey = (f, id(obj))
        self[wrkey] = obj
        self.event_loop_map[wrkey] = loop
863240
def _add_parameter(self, parameter):
        '''
        
        '''
        if isinstance(parameter, MethodParameter):
            # create a bound instance of the MethodParameter
            parameter = parameter.bind(alloy=self)
        self._parameters[parameter.name] = parameter
        for alias in parameter.aliases:
            self._aliases[alias] = parameter
826719
def add_method(obj, func, name=None):
    """"""
    if name is None:
        name = func.__name__
    if sys.version_info < (3,):
        method = types.MethodType(func, obj, obj.__class__)
    else:
        method = types.MethodType(func, obj)
    setattr(obj, name, method)
1278387
def add_methods(self, service):
        """"""
        bindings = {
            "document/literal": Document(self),
            "rpc/literal": RPC(self),
            "rpc/encoded": Encoded(self)}
        for p in service.ports:
            binding = p.binding
            ptype = p.binding.type
            operations = p.binding.type.operations.values()
            for name in (op.name for op in operations):
                m = Facade("Method")
                m.name = name
                m.location = p.location
                m.binding = Facade("binding")
                op = binding.operation(name)
                m.soap = op.soap
                key = "/".join((op.soap.style, op.soap.input.body.use))
                m.binding.input = bindings.get(key)
                key = "/".join((op.soap.style, op.soap.output.body.use))
                m.binding.output = bindings.get(key)
                p.methods[name] = m
1265616
private static <T, G extends T> void generateDrawMethods(DexMaker dexMaker,
                                                             TypeId<G> generatedType,
                                                             TypeId<T> baseType) {
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.DRAW);
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.ON_DRAW);
    }
384576
function createTypedef(context, typeName, value) {
  if (value instanceof Reference) {
    value = value.resolve(context);
  }
  context.results[typeName] = value;
  return value;
}
337313
function proxyFunction (call, args) {
    // get clone of call and reset original
    call = resetCall(call)
    // require immutable core
    assert.ok(GLOBAL.immutableCore !== undefined, 'ImmutableAI configuration error: immutableCore required')
    // require call properties
    assert.ok(call.namespace !== undefined, 'ImmutableAI method call without namespace')
    assert.ok(call.module !== undefined, 'ImmutableAI method call without module name')
    assert.ok(call.method !== undefined, 'ImmutableAI method call without method name')
    // create method signature
    var signature = call.module+GLOBAL.localNamespaces[call.namespace]+'.'+call.method
    // get method - throws error if not found
    var method = GLOBAL.immutableCore.method(signature)
    // create empty object for args if not defined
    if (args === undefined) {
        args = {}
    }
    // set session for args
    args.session = call.session
    // call method with args and session
    return method(args)
}
1185769
def add_handler(self, func, type='all'):
        
        if not callable(func):
            raise ValueError("{} is not callable".format(func))

        self._handlers[type].append(
            (func, len(signature(func).parameters.keys()))
        )
1008173
public static synchronized InvocationHandler putMethodProxy(Method method, InvocationHandler invocationHandler) {
		return methodProxies.put(method, invocationHandler);
	}