/*
@desc: Bind all methods in object with context
@return: Object with method binded
@params: methods object, context (this)
332814
function _bindAll(methods, ctx) {
	var ret = {};
	for (var key in methods) {
		ret[key] = (typeof methods[key] !== "function" ? _bindAll(methods[key], ctx) : methods[key].bind(ctx));
	}
	return ret;
}
20776
def method(method_name)
      new_method = super
      parameters = new_method.parameters
      if parameters.size >= 1 && parameters.last.last == :mock_method
        self.class.instance_method(method_name).bind(self)
      else
        new_method
      end
    end
19096
function bindAutoBindMethod(component, method) {
  var boundMethod = method.bind(component);
  if ("production" !== process.env.NODE_ENV) {
    boundMethod.__reactBoundContext = component;
    boundMethod.__reactBoundMethod = method;
    boundMethod.__reactBoundArguments = null;
    var componentName = component.constructor.displayName;
    var _bind = boundMethod.bind;
    /* eslint-disable block-scoped-var, no-undef */
    boundMethod.bind = function(newThis ) {for (var args=[],$__0=1,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
      // User is trying to bind() an autobound method; we effectively will
      // ignore the value of "this" that the user is trying to use, so
      // let's warn.
      if (newThis !== component && newThis !== null) {
        ("production" !== process.env.NODE_ENV ? warning(
          false,
          'bind(): React component methods may only be bound to the ' +
          'component instance. See %s',
          componentName
        ) : null);
      } else if (!args.length) {
        ("production" !== process.env.NODE_ENV ? warning(
          false,
          'bind(): You are binding a component method to the component. ' +
          'React does this for you automatically in a high-performance ' +
          'way, so you can safely remove this call. See %s',
          componentName
        ) : null);
        return boundMethod;
      }
      var reboundMethod = _bind.apply(boundMethod, arguments);
      reboundMethod.__reactBoundContext = component;
      reboundMethod.__reactBoundMethod = method;
      reboundMethod.__reactBoundArguments = args;
      return reboundMethod;
      /* eslint-enable */
    };
  }
  return boundMethod;
}
335162
function(obj_binding_setter) {
		return function(elements) {
			var vals,
				args = slice.call(arguments, 1);
			if(args.length === 0) { // need at least one argument
				return;
			} else if(args.length === 1) { // an object with keys and values was passed in
				vals = args[0];
			} else if(args.length > 1) { // the first argument was the key, the second was a value
				vals = {};
				vals[args[0]] = args[1];
			}

			var binding = new Binding({
				targets: elements,
				setter: function(element, value) {
					each(value, function(v, k) {
						obj_binding_setter(element, k, v);
					});
				},
				getter: function() {
					if(is_map(vals)) {
						return vals.toObject();
					} else {
						var rv = {};
						each(vals, function(v, k) {
							rv[k] = cjs.get(v);
						});
						return rv;
					}
				}
			});

			return binding;
		};
	}
1018255
def method(self, symbol_name):
        

        s = self.symbol(symbol_name)

        def bind(fn):
            setattr(s, fn.__name__, fn)
        return bind
522278
function doBind(func) {
        /*jshint validthis:true*/
        var args = toArray(arguments),
            bound;

        if (this && !func[$wrapped] && this.$static && this.$static[$class]) {
            func = wrapMethod(null, func, this.$self || this.$static);
        }

        args.splice(1, 0, this);
        bound = bind.apply(func, args);

        return bound;
    }
1299145
function(object) {
		var methods = Array.prototype.slice.call(arguments).slice(1);
		if (!methods.length) {
			methods = gui.Object.ownmethods(object).filter(function(name) {
				return name[0] !== "_"; // exclude private methods
			});
		}
		methods.forEach(function(name) {
			object[name] = object[name].bind(object);
		});
		return object;
	}
810247
function bindFromStrings(target, entity, evt, methods){
    var methodNames = methods.split(/\s+/);

    _.each(methodNames,function(methodName) {

      var method = target[methodName];
      if(!method) {
        throwError("Method '"+ methodName +"' was configured as an event handler, but does not exist.");
      }

      target.listenTo(entity, evt, method, target);
    });
  }
1088979
function bind( fn, scope ) {
    var bound, args;
    if ( fn.bind === nativeBind && nativeBind ) return nativeBind.apply( fn, Array.prototype.slice.call( arguments, 1 ) );
    args = Array.prototype.slice.call( arguments, 2 );
    // @todo: don't link this
    bound = function() {
        if ( !(this instanceof bound) ) return fn.apply( scope, args.concat( Array.prototype.slice.call( arguments ) ) );
        W.ctor.prototype = fn.prototype;
        var self = new ctor();
        var result = fn.apply( self, args.concat( Array.prototype.slice.call( arguments ) ) );
        if ( Object( result ) === result ) return result;
        return self;
    };
    return bound;
}
838253
def get_methods(*objs):
    
    return set(
        attr
        for obj in objs
        for attr in dir(obj)
        if not attr.startswith('_') and callable(getattr(obj, attr))
    )
233783
function (object) {
        ACCEPTABLE_METHODS.forEach(function (method) {
            /**
             * Bind the provided route with a specific method to the callback provided.
             * Since you cannot specify a route more than once, it is required to use bind to provide multiple methods.
             *
             * @param {String} routeName The name of the route. Should be a JavaScript identifier. Optional.
             * @param {String} route The URL for the route.
             * @param {Function} callback The callback to be called when the route is accessed.
             *
             * @throws Error the routeName is already specified
             * @throws Error the route is already specified
             * @throws Error the route does not start with "/"
             * @throws Error an unknown route converter was specified
             *
             * @api public
             * 
             * @example routes.get("/", function(request, response) {
             *     response.end("GET /");
             * });
             * @example routes.post("item", "/{name}", function(request, response, params) {
             *     response.end("GET /" + params.name);
             * });
             */
            object[method] = function (routeName, route, callback) {
                if (arguments.length === 2) {
                    callback = route;
                    route = routeName;
                    routeName = null;
                }
                var descriptor = {};
                descriptor[method] = callback;
                if (arguments.length === 2) {
                    return this.bind(route, descriptor);
                } else {
                    return this.bind(routeName, route, descriptor);
                }
            };
        });
        object.del = object.delete;
    }
313579
function bind (obj, method) {
    var fn = obj[method];
    obj[method] = function () {
      fn.apply(obj, arguments);
    };
  }
1058923
def bind(self, instance, auto=False):
        
        methods = [
            (m, cls.__dict__[m])
            for cls in inspect.getmro(type(instance))
            for m in cls.__dict__ if inspect.isfunction(cls.__dict__[m])
            ]

        try:
            deps_of_endpoints = [(method_ptr, self.entrypoint_deps(method_ptr))
                                 for (method_name, method_ptr) in methods]

            for (method_ptr, method_deps) in deps_of_endpoints:
                if len(method_deps) > 0:
                    method_ptr(instance, **method_deps)
        except KeyError:
            pass

        if auto and instance not in self.current_scope.get_auto_bind_list():
            self.current_scope.auto_bind(instance)

        return instance
661081
function bindAll(self: Object, fnNames: Array<string>) {
  fnNames.forEach(name => {
    /* eslint-disable no-param-reassign */
    self[name] = self[name].bind(self);
    /* eslint-enable no-param-reassign */
  });
}
942587
def construct(self, **bindings):
    
    context = _assign_values_to_unbound_vars(self._unbound_vars, bindings)
    context.update(self._partial_context)
    return self._construct(context)
69985
function bind () {
    if (_bound) return
    let {sub, pub} = getSockets()
    sub.bindSync(`tcp://0.0.0.0:*`)
    pub.bindSync(`tcp://0.0.0.0:*`)
    _sub = sub
    _pub = pub
    _subPort = getSocketPort(_sub)
    _pubPort = getSocketPort(_pub)
    _bound = true
  }
1057807
def bind(proc=nil, &block)
      (proc || block).call(value).tap do |result|

        # def parent_name(obj)
        #   parts = obj.class.name.split('::')
        #   if parts.count > 1
        #     parts[0..-2].join('::')
        #   else
        #     parts[0]
        #   end
        # end

        # self_parent  = parent_name(self)
        # other_parent = parent_name(result)
        # raise NotMonadError, "Expected #{result.inspect} to be an #{other_parent}" unless self_parent == other_parent

        parent = self.class.superclass === Object ? self.class : self.class.superclass
        raise NotMonadError, "Expected #{result.inspect} to be an #{parent}" unless result.is_a? parent
      end
    end