def setup(self, thread_id, **kwargs):
        '''
        init the connection and do other necessary stuff
        '''
        self.thread_id = thread_id

        # get the credentials from the main config in kwargs
        if 'worker_credentials' in kwargs:
            if kwargs['worker_credentials'] in self.name:
                self.creds.update(kwargs['worker_credentials'][self.name])
            elif 'all' in kwargs['worker_credentials']:
                self.creds.update(kwargs['worker_credentials']['all'])
            else:
                log.info('{0}# no credentials loaded from config'.format(self.thread_id))

        # create the mysql connection and get the cursor
        self.conn = MysqlConn(
            self.creds['hostname'],
            self.creds['username'],
            self.creds['password'],
            self.creds['database'],
            self.thread_id,
        )

        self.cursor = self.conn.get_cursor()

        # keep track of the events dumped
        self.dumped = 0

        log.info("{0}# Worker '{1}' initiated".format(self.thread_id, self.name))
dataset/ETHPy150Open felskrone/salt-eventsd/doc/share/doc/eventsd_workers/New_Job_Worker.py/New_Job_Worker.setup/swapped operands of `in`