<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_candidate(self, filename=None, config=None):
 """ Loads a candidate configuration on the device. In case the load fails at any point, will automatically rollback to last working configuration. :param filename: Specifies the name of the file with the configuration content. :param config: New configuration to be uploaded on the device. :raise pyPluribus.exceptions.ConfigLoadError: When the configuration could not be uploaded to the device. """


        configuration = ''

        if filename is None:
            configuration = config
        else:
            with open(filename) as config_file:
                configuration = config_file.read()

        return self._upload_config_content(configuration)