Takes the sum of all instantaneous active power values
        Returns them in kWh

        Returns
        -------
        float
422222
def active_power(self):
        
        inst = self.load_instantaneous()
        values = [float(i['value']) for i in inst if i['key'].endswith('ActivePower')]
        return sum(values) / 1000
666867
public float getVoltage() {
        // Range mapping from http://stackoverflow.com/a/7506169/254187
        float inMin = 0;
        float inMax = 100;
        float outMin = (float) 2.0;
        float outMax = (float) 3.7;
        float x = this.percentage;

        return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
    }
191023
def softmax(values):
    
    e_values = list(map(exp, values))
    s = sum(e_values)
    inv_s = 1.0 / s
    return [ev * inv_s for ev in e_values]
457074
def pvwatts_dc(self, g_poa_effective, temp_cell):
        
        kwargs = _build_kwargs(['temp_ref'], self.module_parameters)

        return pvwatts_dc(g_poa_effective, temp_cell,
                          self.module_parameters['pdc0'],
                          self.module_parameters['gamma_pdc'],
                          **kwargs)
1261144
def sum(self, default=None):
        
        return numpy.asscalar(numpy.sum(self.values)) if self.values else default
1065020
def total_energy
      etot = self.geometry_steps.collect{|gs| gs.total_energy }.compact.last
      if etot.nil? 
        Float::NAN
      else
        etot
      end
    end
514082
def calculate_current_allocation(self):
        
        for ac in self.asset_classes:
            ac.curr_alloc = ac.curr_value * 100 / self.total_amount
882588
def total_energy(self):
        
        return sum(sum(self._recip)) + sum(sum(self._real)) + sum(self._point) + self._charged_cell_energy
561601
def current_consumption(self):
        """"""
        res = 'N/A'
        if self.use_legacy_protocol:
            # Use /my_cgi.cgi to retrieve current consumption
            try:
                res = self.fetchMyCgi()['Meter Watt']
            except:
                return 'N/A'
        else:
            try:
                res = self.SOAPAction('GetCurrentPowerConsumption', 'CurrentConsumption', self.moduleParameters("2"))
            except:
                return 'N/A'

        if res is None:
            return 'N/A'

        try:
            res = float(res)
        except ValueError:
            _LOGGER.error("Failed to retrieve current power consumption from SmartPlug")

        return res
1133426
def get_installed_power(self):
        

        """
        for wind_farm in self.wind_farms:
            wind_farm.installed_power = wind_farm.get_installed_power()
        return sum(wind_farm.installed_power for wind_farm in self.wind_farms)
554900
def get_total_paid(self) -> Decimal:
        
        query = (
            self.get_splits_query()
        )
        splits = query.all()

        total = Decimal(0)
        for split in splits:
            total += split.value

        return total
1219800
def get(self):
        
        if self.num is None:
            if self.num_inst == 0:
                return (self.name, float('nan'))
            else:
                return (self.name, self.sum_metric / self.num_inst)
        else:
            names = ['%s'%(self.name[i]) for i in range(self.num)]
            values = [x / y if y != 0 else float('nan') \
                for x, y in zip(self.sum_metric, self.num_inst)]
            return (names, values)
643938
def get_current_value(self):
        
        if self.agent.training:
            # Linear annealed: f(x) = ax + b.
            a = -float(self.value_max - self.value_min) / float(self.nb_steps)
            b = float(self.value_max)
            value = max(self.value_min, a * float(self.agent.step) + b)
        else:
            value = self.value_test
        return value
1200602
def sum(self):
        
        return LazyOpResult(
            grizzly_impl.aggr(
                self.expr,
                "+",
                0,
                self.weld_type
            ),
            self.weld_type,
            0
        )
839522
def get_consumption(self):
        """"""
        self.get_status()
        try:
            self.consumption = self.data['power']
        except TypeError:
            self.consumption = 0

        return self.consumption
1363023
def getV0(self, v_mag_guess, buses, generators, type=CASE_GUESS):
        
        if type == CASE_GUESS:
            Va = array([b.v_angle * (pi / 180.0) for b in buses])
            Vm = array([b.v_magnitude for b in buses])
            V0 = Vm * exp(1j * Va)
        elif type == FLAT_START:
            V0 = ones(len(buses))
        elif type == FROM_INPUT:
            V0 = v_mag_guess
        else:
            raise ValueError

        # Set the voltages of PV buses and the reference bus in the guess.
#        online = [g for g in self.case.generators if g.online]
        gbus = [g.bus._i for g in generators]
        Vg = array([g.v_magnitude for g in generators])

        V0[gbus] = Vg * abs(V0[gbus]) / V0[gbus]

        return V0
461924
def getVATAmount(self):
        
        price, vat = self.getAnalysisProfilePrice(), self.getAnalysisProfileVAT()
        return float(price) * float(vat) / 100