<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setConfiguration(self, configuration):
 r"""Set the active configuration of a device. Arguments: configuration: a configuration value or a Configuration object. """

        if isinstance(configuration, Configuration):
           configuration = configuration.value

        self.dev.set_configuration(configuration)