Just to make the interface compatible
963785
def call(word, opts)
      validate_opts!(opts)
      driver = Smartdict::Core::DriverManager.find(opts[:driver])

      translation_model = Models::Translation.find(word, opts[:from_lang], opts[:to_lang], opts[:driver])
      unless translation_model
        translation = driver.translate(word, opts[:from_lang], opts[:to_lang])
        translation_model = Models::Translation.create_from_struct(translation)
      end
      log_query(translation_model) if opts[:log]
      translation_model.to_struct
    end
521331
def make_connector(self, app=None, bind=None):
        """"""
        return _EngineConnector(self, self.get_app(app), bind)
289628
def is_compatible(self):
        """"""
        for pattern in OPTIONS['compatible_patterns']:
            if fnmatch(self.package.lower(), pattern):
                return True
        return False
402331
def attach(self, gui):
        """"""
        super(FeatureView, self).attach(gui)
        self.actions.add(self.increase)
        self.actions.add(self.decrease)
        self.actions.separator()
        self.actions.add(self.clear_channels)
        self.actions.add(self.toggle_automatic_channel_selection)

        gui.connect_(self.on_channel_click)
        gui.connect_(self.on_request_split)
1301001
def interface(self):
        
        
        # Possible control arguments
        controls = {
            'start': self.do_start,
            'stop': self.do_stop,
            'status': self.do_status,
            'restart': self.do_restart,
            'reload': self.do_restart    
        }
        
        # Process the control argument
        try:
            controls[self.command]()
        except KeyError:
            self.write_stdout('Usage: {} {{start|stop|status|restart|reload}}'.format(self.name), 3)
        exit(0)
438903
def interface(self, context):
        """"""
        self.context = context
        self.callback = self.context.get("callback")
379009
def connect(self, interface=None):
        
        if self._simulate:
            return True
        if not interface:
            match = self._autodiscover_usb()
            self._log.debug("Auto-discovered USB port: %s" % match)
        else:
            self.USB_PORT = interface

        try:
            self._conn = serial.Serial(self.USB_PORT, baudrate=self.BAUDRATE,
                                       bytesize=self.BYTE_SIZE,
                                       parity=self.PARITY,
                                       stopbits=self.STOPBITS,
                                       timeout=self.TIMEOUT)
        except serial.serialutil.SerialException as e:
            raise SerialConnectionError(str(e))

        self._log.debug("Serial connection set")
        if not self._conn.isOpen():
            self._conn.open()
            self._log.debug("Serial connection opened")
        return True
514644
def add_interface_router(self, router, body=None):
        """"""
        return self.put((self.router_path % router) + "/add_router_interface",
                        body=body)
1074224
def _isCompatible(self, other, reporter):
        
        segment1 = self
        segment2 = other
        # type
        if segment1.type != segment2.type:
            # line <-> curve can be converted
            if set((segment1.type, segment2.type)) != set(("curve", "line")):
                reporter.typeDifference = True
                reporter.fatal = True
193196
private static void addInterfaces(Object obj, Set<Class<?>> interfaces) {

		Class<?>[] generatorInterfaces = null;
		Class<?> superClass = null;
		if (obj instanceof Class) {
			generatorInterfaces = ((Class<?>) obj).getInterfaces();
			superClass = ((Class<?>) obj).getSuperclass();
		} else {
			generatorInterfaces = obj.getClass().getInterfaces();
			superClass = obj.getClass().getSuperclass();
		}
		for (Class<?> generatorInterface : generatorInterfaces) {
			interfaces.add(generatorInterface);
			addInterfaces(generatorInterface, interfaces);
		}

		if (superClass != null && superClass != Object.class) {
			addInterfaces(superClass, interfaces);
		}
	}
806210
def add_interface(zone, interface, permanent=True):
    '''
    
    '''
    if interface in get_interfaces(zone, permanent):
        log.info('Interface is already bound to zone.')

    cmd = '--zone={0} --add-interface={1}'.format(zone, interface)

    if permanent:
        cmd += ' --permanent'

    return __firewall_cmd(cmd)
924731
def open_compat(*args, **kwargs):
    
    if six.PY3:
        return open(*args, **kwargs)

    else:
        f = io.open(*args, **kwargs)

        if f.encoding and f.encoding.lower().replace("-", "") == "utf8":
            write_orig = f.write

            def write(data, *args, **kwargs):
                u = unicode  # noqa: F821
                if not isinstance(data, u):
                    data = u(data)
                return write_orig(data, *args, **kwargs)

            f.write = write

        return f
172626
def interface_by_name(self, name):
        '''
        
        '''
        if name in self._devinfo:
            return self._devinfo[name]
        raise KeyError("No device named {}".format(name))
1265293
public boolean compatiable(StreamInfo info) {
        if (sampleRate != info.sampleRate) return false;
        if (channels != info.channels) return false;
        if (bitsPerSample != info.bitsPerSample) return false;
        return true;
    }
174753
void addImplementedInterface(final String interfaceName, final Map<String, ClassInfo> classNameToClassInfo) {
        final ClassInfo interfaceClassInfo = getOrCreateClassInfo(interfaceName,
                /* classModifiers = */ Modifier.INTERFACE, classNameToClassInfo);
        interfaceClassInfo.isInterface = true;
        interfaceClassInfo.modifiers |= Modifier.INTERFACE;
        this.addRelatedClass(RelType.IMPLEMENTED_INTERFACES, interfaceClassInfo);
        interfaceClassInfo.addRelatedClass(RelType.CLASSES_IMPLEMENTING, this);
    }
442110
public static <T extends TypeDescription> ElementMatcher.Junction<T> isInterface() {
        return new ModifierMatcher<T>(ModifierMatcher.Mode.INTERFACE);
    }
283484
def interface_options(score=False, raw=False, features=None, rgb=None):
  """"""
  interface = sc_pb.InterfaceOptions()
  interface.score = score
  interface.raw = raw
  if features:
    interface.feature_layer.width = 24
    interface.feature_layer.resolution.x = features
    interface.feature_layer.resolution.y = features
    interface.feature_layer.minimap_resolution.x = features
    interface.feature_layer.minimap_resolution.y = features
  if rgb:
    interface.render.resolution.x = rgb
    interface.render.resolution.y = rgb
    interface.render.minimap_resolution.x = rgb
    interface.render.minimap_resolution.y = rgb
  return interface