def __perform_config_checks(self):
        """Perform checks for common configuration errors.  Raises an exception with a human-readable message
        if any of the checks fail.

        In particular, this checks if (1) the user has actually entered an api_key, (2) the agent process can
        write to the logs directory, (3) we can send a request to the the configured scalyr server
        and (4) the api key is correct.
        """
        # Make sure the user has set an API key... a common step that can be forgotten.
        # If they haven't set it, it will have REPLACE_THIS as the value since that's what is in the template.
        if self.__config.api_key == 'REPLACE_THIS' or self.__config.api_key == '':
            raise Exception('Error, you have not set a valid api key in the configuration file.\n'
                            'Edit the file %s and replace the value for "api_key" with a valid logs '
                            'write key for your account.\n'
                            'You can see your write logs keys at https://www.scalyr.com/keys' %
                            self.__config.file_path)

        self.__verify_can_write_to_logs_and_data(self.__config)

        # Send a test message to the server to make sure everything works.  If not, print a decent error message.
        client = self.__create_client(quiet=True)
        try:
            ping_result = client.ping()
            if ping_result != 'success':
                if 'badClientClockSkew' in ping_result:
                    # TODO:  The server does not yet send this error message, but it will in the future.
                    raise Exception('Sending request to the server failed due to bad clock skew.  The system clock '
                                    'on this host is too off from actual time.  Please fix the clock and try to '
                                    'restart the agent.')
                elif ping_result in 'invalidApiKey':
                    # TODO:  The server does not yet send this error message, but it will in the future.
                    raise Exception('Sending request to the server failed due to an invalid API key.  This probably '
                                    'means the \'api_key\' field in configuration file  \'%s\' is not correct.  '
                                    'Please visit https://www.scalyr.com/keys and copy a Write Logs key into the '
                                    '\'api_key\' field in the configuration file' % self.__config.file_path)
                else:
                    raise Exception('Failed to send request to the server.  The server address could be wrong, there '
                                    'maybe a network connectivity issue, or the provided api_token could be '
                                    'incorrect.')
        finally:
            client.close()
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/agent_main.py/ScalyrAgent.__perform_config_checks/swapped operands of `in`