def _adjust_too_small()

in docker/services/resize/resize_service.py [0:0]


    def _adjust_too_small(self, shapes: List[Shape],
                          recommendation: RecommendationHistory):
        recommended_shapes_data = self._get_recommended_shapes(
            recommendation=recommendation,
            max_items=SHAPES_COUNT_TO_ADJUST
        )
        recommended_cpu = [item.get('cpu') for item in recommended_shapes_data
                           if isinstance(item.get('cpu'), (int, float))]
        recommended_memory = [item.get('memory') for item in
                              recommended_shapes_data
                              if isinstance(item.get('memory'), (int, float))]

        threshold_cpu = max(recommended_cpu)
        threshold_memory = max(recommended_memory)

        result_shapes = []
        for shape in shapes:

            # shape cpu/memory must be >=, but
            # at least one of them must be higher than a threshold value
            if shape.cpu >= threshold_cpu and shape.memory >= threshold_memory \
                    and (shape.cpu != threshold_cpu
                         or threshold_memory != shape.memory):
                result_shapes.append(shape)
        return result_shapes