@classmethod
    def best_for(cls, plan, environment, name):
        datainfras = list(
            DatabaseInfra.get_active_for(plan=plan, environment=environment))
        if not datainfras:
            return None
        datainfras.sort(key=lambda di: -di.available)
        best_datainfra = datainfras[0]
        if best_datainfra.available <= 0:
            return None
        return best_datainfra
Choose the best DatabaseInfra for another database
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/physical/models.py/DatabaseInfra.best_for