def session_check(self, log_dir, job_id):
        """
        Check for existing session and return the ID if present
        else False

        Arguments
        ---------
        log_dir: str
            directory containing cracker log and session files
        job_id: str
            job/session id string (alnum)
        Returns
        -------
        sess_id: bool
            True if session/job ID is valid and present
        """
        logger.debug('Checking for existing session')
        log_dir = Path(log_dir)
        sess_id = False
        if job_id.isalnum() or isinstance(job_id, uuid):
        #if job_id.isalnum():
            try:
                for f in Path.iterdir(log_dir):
                    if str(job_id) in str(f):
                        sess_id = True
                        break
            except ValueError as err:
                logger.debug('Invalid session ID: {}'.format(err))
                sess_id = False
            except Exception as err:
                logger.warning('Invalid session: {}'.format(err))
                sess_id = False
        else:
            logger.debug('Invalid session ID provided')
            sess_id = False
        if sess_id is not False:
            logger.debug('Existing session found')
        return sess_id

        Check for existing session and return the ID if present
        else False

        Arguments
        ---------
        log_dir: str
            directory containing cracker log and session files
        job_id: str
            job/session id string (alnum)
        Returns
        -------
        sess_id: bool
            True if session/job ID is valid and present
        
crackq/cq_api.py