parameters: (self, gain_or_power)
docstring: Call this if a gain or power value changed, but you're not sure which it
          is.
  
          If it's a power, we subtract the signal offset to generate a reference
          power.
docstring_summary: Call this if a gain or power value changed, but you're not sure which it
          is.
docstring_tokens: Call this if a gain or power value changed but you re not sure which it is .
function: def set_gain_or_power(self, gain_or_power):
          """
          Call this if a gain or power value changed, but you're not sure which it
          is.
  
          If it's a power, we subtract the signal offset to generate a reference
          power.
          """
          if self.gain_type == self.GAIN_TYPE_POWER:
              self.set_power_reference(
                  gain_or_power - 20 * math.log10(self[AMPLITUDE_KEY]))
          else:
              self.set_gain(gain_or_power)
function_tokens: def set_gain_or_power ( self , gain_or_power ) : if self . gain_type == self . GAIN_TYPE_POWER : self . set_power_reference ( gain_or_power - 20 * math . log10 ( self [ AMPLITUDE_KEY ] ) ) else : self . set_gain ( gain_or_power )