<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_diagnosis(self, remediation_id=None):
        '''
            returns JSON of diagnosis data on success, None on failure
            Optional arg remediation_id to get a particular remediation set.
        '''
        if self.config.offline:
            logger.error('Cannot get diagnosis in offline mode.')
            return None
        return self.connection.get_diagnosis(remediation_id)