def _encode(self, rosMsg):
        """ Internally used method which is responsible for the heavy lifting.
        """
        data = {}

        for (slotName, slotType) in zip(rosMsg.__slots__, rosMsg._slot_types):
            if '[]' == slotType[-2:]:
                listBool = True
                slotType = slotType[:-2]
            else:
                listBool = False

            if self._BASE_TYPES in slotType:
                convFunc = self._BASE_TYPES[slotType]
            elif slotType in self._SPECIAL_TYPES:
                convFunc = self._SPECIAL_TYPES[slotType]().encode
            elif slotType in self._customTypes:
                convFunc = self._customTypes[slotType][0]().encode
            else:
                convFunc = self._encode

            if listBool:
                convFunc = partial(map, convFunc)

            try:
                data[slotName] = convFunc(getattr(rosMsg, slotName))
            except ValueError as e:
                raise ValueError('{0}.{1}: {2}'.format(
                                     rosMsg.__class__.__name__, slotName, e))

        return data
dataset/ETHPy150Open rapyuta/rce/rce-core/rce/util/converter.py/Converter._encode/swapped operands of `in`