Implements interface

@param {string} name      Interface name
@param {object} interfaze Interface
@returns {clazz|object} this

@this {clazz|object}
974281
function(name, interfaze) {
            if (-1 !== this.__interfaces.indexOf(name)) {
                throw new Error('Interface "' + name + '" is already implemented!');
            }
            this.__interfaces.push(name);
            _.extend(this, interfaze);
            return this;
        }
912887
public ClassNode addInterface(String name) {
        ClassNode intf = infoBase.node(name);
        addInterface(intf);
        return this;
    }
849098
function(prototype) {
            var reflector = new JOII.Reflection.Class(prototype),
                properties = this.reflector.getProperties(),
                methods = this.reflector.getMethods(),
                i, p1, p2;

            // If the class is marked as 'abstract', running interface validation
            // on it is rather useless since the class can't be instantiated.
            if (reflector.isAbstract()) {
                return true;
            }

            var verifyMeta = function(t, p1, p2, prefix) {
                if (p1.getVisibility() !== p2.getVisibility()) {
                    throw prefix + ' ' + p2.getName() + ' cannot be ' + p2.getVisibility() + ' because the interface declared it ' + p1.getVisibility() + '.';
                }
                if (prefix != 'Method') {
                    if (p1.getType() !== p2.getType()) {
                        throw prefix + ' ' + p2.getName() + ' cannot be declared as ' + p2.getType() + ' because the interface declared it as ' + p1.getType() + '.';
                    }
                    if (p1.isNullable() !== p2.isNullable()) {
                        throw prefix + ' ' + p2.getName() + ' must be nullable as defined in the interface ' + t.name + '.';
                    }
                }
                return true;
            };


            // Verify that all properties exist and have the correct metadata.
            for (i in properties) {
                if (properties.hasOwnProperty(i) === false) continue;
                p1 = properties[i];
                
                if (p1.isStatic() && !reflector.isStatic()) continue;
                if (!p1.isStatic() && reflector.isStatic()) continue;


                if (!reflector.hasProperty(p1.getName())) {
                    throw 'Class must implement ' + (p1.toString().split(':')[0]) + ' as defined in the interface ' + this.name + '.';
                }
                p2 = reflector.getProperty(p1.getName());

                // Verify meta data
                verifyMeta(this, p1, p2, 'Property');
            }

            // Verify methods.
            for (i in methods) {
                if (methods.hasOwnProperty(i) === false) continue;
                p1 = methods[i];

                if (p1.isStatic() && !reflector.isStatic()) continue;
                if (!p1.isStatic() && reflector.isStatic()) continue;

                if (!reflector.hasMethod(p1.getName())) {
                    throw 'Class must implement ' + (p1.toString().split(':')[0]) + ' as defined in the interface ' + this.name + '.';
                }
                p2 = reflector.getMethod(p1.getName());

                // Verify meta data
                verifyMeta(this, p1, p2, 'Method');

                // Verify function signature.
                var args_interface = p1.getParameters();
                var args_class = p2.getParameters();

                if (args_interface.length == 0 || typeof (args_interface[0]) !== 'object') {
                    // fallback for backwards compatibility
                    if (args_interface.length !== args_class.length) {
                        throw 'Method ' + p1.getName() + ' does not match the parameter count as defined in the interface ' + this.name + '.';
                    }
                } else {
                    for (var idx = 0; idx < args_interface.length; idx++) {
                        var interface_parameters_meta = args_interface[idx];

                        var different = true;

                        for (var x = 0; x < args_class.length; x++) {
                            var class_parameters_meta = args_class[x];

                            if (interface_parameters_meta.length === class_parameters_meta.length) {
                                // this signature has the same number of types as the new signature
                                // check to see if the types are the same (duplicate signature)
                                different = false;

                                for (var y = 0; y < interface_parameters_meta.length; y++) {
                                    if (interface_parameters_meta[y].type != class_parameters_meta[y].type) {
                                        different = true;
                                    }
                                }
                                if (!different) {
                                    break;
                                }
                            }
                        }
                        if (different) {
                            throw 'Method ' + p1.getName() + ' does not match the parameter types as defined in the interface ' + this.name + '.';
                        }
                    }
                }
            }
        }
399089
private void visitInterfacePropertyAssignment(Node object, Node lvalue) {
    if (!lvalue.getParent().isAssign()) {
      // assignments to interface properties cannot be in destructuring patterns or for-of loops
      reportInvalidInterfaceMemberDeclaration(object);
      return;
    }
    Node assign = lvalue.getParent();
    Node rvalue = assign.getSecondChild();
    JSType rvalueType = getJSType(rvalue);

    // Only 2 values are allowed for interface methods:
    //    goog.abstractMethod
    //    function () {};
    // Other (non-method) interface properties must be stub declarations without assignments, e.g.
    //     someinterface.prototype.nonMethodProperty;
    // which is why we enforce that `rvalueType.isFunctionType()`.
    if (!rvalueType.isFunctionType()) {
      reportInvalidInterfaceMemberDeclaration(object);
    }

    if (rvalue.isFunction() && !NodeUtil.isEmptyBlock(NodeUtil.getFunctionBody(rvalue))) {
      String abstractMethodName = compiler.getCodingConvention().getAbstractMethodName();
      compiler.report(JSError.make(object, INTERFACE_METHOD_NOT_EMPTY, abstractMethodName));
    }
  }
107194
private void expectInterfaceProperty(
      Node n, ObjectType instance, ObjectType implementedInterface, String prop) {
    StaticTypedSlot propSlot = instance.getSlot(prop);
    if (propSlot == null) {
      // Not implemented
      String sourceName = n.getSourceFileName();
      sourceName = nullToEmpty(sourceName);
      registerMismatch(
          instance,
          implementedInterface,
          report(
              JSError.make(
                  n,
                  INTERFACE_METHOD_NOT_IMPLEMENTED,
                  prop,
                  implementedInterface.toString(),
                  instance.toString())));
    } else {
      Node propNode =
          propSlot.getDeclaration() == null ? null : propSlot.getDeclaration().getNode();

      // Fall back on the constructor node if we can't find a node for the
      // property.
      propNode = propNode == null ? n : propNode;

      JSType found = propSlot.getType();
      found = found.restrictByNotNullOrUndefined();

      JSType required
          = implementedInterface.getImplicitPrototype().getPropertyType(prop);
      TemplateTypeMap typeMap = implementedInterface.getTemplateTypeMap();
      if (!typeMap.isEmpty()) {
        TemplateTypeMapReplacer replacer = new TemplateTypeMapReplacer(
            typeRegistry, typeMap);
        required = required.visit(replacer);
      }
      required = required.restrictByNotNullOrUndefined();

      if (!found.isSubtype(required, this.subtypingMode)) {
        // Implemented, but not correctly typed
        FunctionType constructor =
            implementedInterface.toObjectType().getConstructor();
        JSError err =
            JSError.make(
                propNode,
                HIDDEN_INTERFACE_PROPERTY_MISMATCH,
                prop,
                instance.toString(),
                constructor.getTopMostDefiningType(prop).toString(),
                required.toString(),
                found.toString());
        registerMismatch(found, required, err);
        report(err);
      }
    }
  }
102302
def dev_from_name(self, name):
        
        try:
            return next(iface for iface in six.itervalues(self)
                        if (iface.name == name or iface.description == name))
        except (StopIteration, RuntimeError):
            raise ValueError("Unknown network interface %r" % name)
1012874
function Plugin(script, _interface, options) {
  this._script = script
  this._options = options || {}
  this._initialInterface = _interface || {}
  this._connect()
}
1023019
function (name, module) {
        var _interface = makeInterface(this, name, module),
            proxy = makeProxy(this, name, _interface)

        extend(module, {
            emit: proxy.emit
        })

        this._modules[name] = module
        this._interfaces[name] = _interface
        this.proxies[name] = proxy

        return proxy
    }
780058
function (context, interfaceName) {
        if (typeof arguments[0] === 'string') {
            interfaceName = arguments[0];
            context = undefined;
        }

        context = context || {};

        if (this.context) {
            // inherit from existing context if any
            var self = this;
            Object.keys(this.context).forEach(function forEach(name) {
                if (name.charAt(0) !== '$' && !context[name]) {
                    context[name] = self.context[name];
                }
            });
        }

        // bind context to the points
        var head = this.copy(context);

        var current = head;
        while(current) {
            var ret = current.handler(current, current.config);
            if (ret && !ret._handlersConfigured) {
                if (ret instanceof PipePoint) {
                    // if pipe is returned, let's attach it to the existing one
                    current.link(ret);
                }
                else {
                    current.handler = ret;
                    current.handler(current, current.config);
                }
            }
            current = current._next$ ?
                current._next$.copy(context) : undefined;
        }
        context.$inited = true;

        if (!interfaceName) {
            return head;
        }

        var api = head.get(interfaceName);
        if (!api) {
            throw new Error('Cannot find requested API: ' + interfaceName);
        }
        return api(head);
    }
277213
function(name, config) {
        if (typeof name !== 'string') {
          throw new TypeError('expected the first argument to be a string');
        }
        if (utils.isObject(config)) {
          config.name = name;
        }
        this.emit('scaffold.set', name, config);
        this.scaffolds[name] = config;
        return this;
      }
838271
public ISarlInterfaceBuilder addSarlInterface(String name) {
		ISarlInterfaceBuilder builder = this.sarlInterfaceProvider.get();
		builder.eInit(getScript(), name, getTypeResolutionContext());
		return builder;
	}
468088
def set_interface(interface, name=''):
    
    global interfaces

    if not interface: raise ValueError('interface is empty')

    # close down the interface before we discard it
    if name in interfaces:
        interfaces[name].close()

    interfaces[name] = interface
1331175
function (name, newValue) {
		var property = this.getProperty(name);
		if (!property) {
			this.initProperty(name, newValue);
		}
		else {
			property.set(newValue);
		}
	}
172626
def interface_by_name(self, name):
        '''
        
        '''
        if name in self._devinfo:
            return self._devinfo[name]
        raise KeyError("No device named {}".format(name))
1059070
function registerInternal(config) {
    // In order to support both Closure-compiled and uncompiled code accessing
    // this method, we need to allow for both the dot and array syntax for
    // property access. You'll therefore see the `foo.bar || foo['bar']`
    // pattern repeated across this method.
    var widgetMissing = (typeof config.widget === 'undefined' &&
        typeof config['widget'] === 'undefined');
    var widget = true;

    if (!widgetMissing) {
      widget = config.widget || config['widget'];
    }

    var newConfig = /** @type {componentHandler.ComponentConfig} */ ({
      classConstructor: config.constructor || config['constructor'],
      className: config.classAsString || config['classAsString'],
      cssClass: config.cssClass || config['cssClass'],
      widget: widget,
      callbacks: []
    });

    registeredComponents_.forEach(function(item) {
      if (item.cssClass === newConfig.cssClass) {
        throw new Error('The provided cssClass has already been registered: ' + item.cssClass);
      }
      if (item.className === newConfig.className) {
        throw new Error('The provided className has already been registered');
      }
    });

    if (config.constructor.prototype
        .hasOwnProperty(componentConfigProperty_)) {
      throw new Error(
          'MDL component classes must not have ' + componentConfigProperty_ +
          ' defined as a property.');
    }

    var found = findRegisteredClass_(config.classAsString, newConfig);

    if (!found) {
      registeredComponents_.push(newConfig);
    }
  }
442748
function(name, protocols, requiredInstanceMethodDefs, requiredClassMethodDefs)
{
    this.name = name;
    this.protocols = protocols;
    if (requiredInstanceMethodDefs)
        this.requiredInstanceMethods = requiredInstanceMethodDefs;
    if (requiredClassMethodDefs)
        this.requiredClassMethods = requiredClassMethodDefs;
}
937061
public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) {
		if (this.sarlInterface == null) {
			this.container = container;
			this.sarlInterface = SarlFactory.eINSTANCE.createSarlInterface();
			container.getMembers().add(this.sarlInterface);
			if (!Strings.isEmpty(name)) {
				this.sarlInterface.setName(name);
			}
		}
	}