def __init__(self, motor_config):
        """Initialize a set of DMCCs and their associated motors

        :param motor_config: Config entry mapping motor names to DMCC ids and
        motor indices

        Dictionary entries are in the format:
            <motor_name>: { board_num: [0-3], motor_num: [1-2] }

        """
        self.config = lib.get_config("bot/config.yaml")
        self.logger = lib.get_logger()
        self.is_testing = self.config["test_mode"]["DMCC"]

        # print "Testing: ", self.config["testing"]
        # print pyDMCC.lib._config

        # This instantiates all DMCCs in every DMCCManager, which is probably
        # not optimal, which works fine for our purposes.  Potentially better
        # approaches:
        #  - global state: shared dmccs dictionary, instantiated once
        #  - selected instantiation: only initialize the dmccs we are control
        if not self.is_testing:
            dmccs = pyDMCC.autodetect()
            self.logger.debug("Found %d physical DMCC boards" % len(dmccs))
        else:
            self.logger.debug("Skipping autodetect due to test mode")
            dmccs = defaultdict(
                lambda: pyDMCC.DMCC(
                    0, verify=False, bus=None, logger=self.logger))

        self.logger.debug("DMCC Motor conf: {}".format(dmccs))

        self.motors = {}
        for name, conf in motor_config.items():
            if 'invert' in conf.keys():
                invert = conf['invert']
            else:
                invert = False
            try:
                self.motors[name] = DMCCMotor(
                    dmccs[conf['board_num']], conf['motor_num'], invert)
            except __HOLE__:
                self.logger.error(
                    "Bad motor definition for motor: '{}'".format(
                        name))
                raise

        self.logger.debug("Setup {}".format(self))
dataset/ETHPy150Open IEEERobotics/bot/bot/hardware/dmcc_motor.py/DMCCMotorSet.__init__