def configure_switch(self, config):

        if not self.net_connection:
            self.log.critical("A request was made to configure a FAST switch, "
                              "but no connection to a NET processor is "
                              "available")
            sys.exit()

        if self.machine_type == 'wpc':  # translate switch number to FAST switch
            config['number'] = self.wpc_switch_map.get(
                                                config['number_str'].upper())
            if 'connection' not in config:
                config['connection'] = 0  # local switch (default for WPC)
            else:
                config['connection'] = 1  # network switch

        elif self.machine_type == 'fast':
            if 'connection' not in config:
                config['connection'] = 1  # network switch (default for FAST)
            else:
                config['connection'] = 0  # local switch

            if self.config['config_number_format'] == 'int':
                config['number'] = Util.int_to_hex_string(config['number'])
            else:
                config['number'] = Util.normalize_hex_string(config['number'])

        # convert the switch number into a tuple which is:
        # (switch number, connection)
        config['number'] = (config['number'], config['connection'])

        if not config['debounce_open']:
            config['debounce_open'] = self.config['default_debounce_open']

        if not config['debounce_close']:
            config['debounce_close'] = self.config['default_debounce_close']

        self.log.debug("FAST Switch hardware tuple: %s", config['number'])

        switch = FASTSwitch(number=config['number'],
                            debounce_open=config['debounce_open'],
                            debounce_close=config['debounce_close'],
                            sender=self.net_connection.send)

        return switch, config['number']
Load the component with the specified name and version.
dataset/ETHPy150Open missionpinball/mpf/mpf/platform/fast.py/HardwarePlatform.configure_switch--crossover with--dataset/ETHPy150Open google/grr/grr/lib/flows/general/transfer.py/LoadComponentMixin.LoadComponentOnClient