def load_candidate(self, filename=None, config=None):
configuration = '<STR_LIT>'<EOL>if filename is None:<EOL><INDENT>configuration = config<EOL><DEDENT>else:<EOL><INDENT>with open(filename) as config_file:<EOL><INDENT>configuration = config_file.read()<EOL><DEDENT><DEDENT>return self._upload_config_content(configuration)<EOL>
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.