def optimize(self, to_buy, to_sell):
        allocations = {}

        # Process every stock the same way
        for s in to_buy:
            quantity = self.properties.get('buy_amount', 100)
            if s in self.properties.get('scale', {}):
                quantity *= self.properties['scale'][s]
            # Allocate defined amount to buy
            allocations[s] = int(quantity)

        # NOTE You must provide sell_amount if you want to short
        for s in to_sell:
            quantity = self.properties.get(
                'sell_amount', self.portfolio.positions[s].amount)
            if s in self.properties.get('scale', {}):
                quantity *= self.properties['scale'][s]
            # Allocate defined amount to buy
            allocations[s] = -int(quantity)

        # Defaults values
        e_ret = 0
        e_risk = 1
        return allocations, e_ret, e_risk
Return a dictionary containing key-value pairs for the information
dataset/ETHPy150Open intuition-io/insights/insights/managers/linear.py/Constant.optimize--crossover with--dataset/ETHPy150Open nir0s/distro/distro.py/LinuxDistribution.distro_release_info