# Path: pyDEA/core/utils/dea_utils.py
# def is_efficient(efficiency_score, lambda_variable):
#     ''' Checks if dmu with given efficiency score and value of
#         lambda variable is efficient.
# 
#         Args:
#             efficiency_score (double): efficiency spyDEA.core.
#             lambda_variable (double): value of lambda variable corresponding
#                 to DMU under consideration.
# 
#         Returns:
#             bool: True if DMU is efficient, False otherwise.
# 
#         Example:
#             >>> is_efficient(1, 1)
#             True
#             >>> is_efficient(0.5, 0)
#             False
#             >>> is_efficient(0.9999999, 1)
#             True
#             >>> is_efficient(1.0000001, 1)
#             True
# 
#     '''
#     if efficiency_score == 1:
#         return True
#     if lambda_variable > ZERO_TOLERANCE:
#         return True
#     # it seems that lambda_variable is not ultimate indication of efficiency
#     if efficiency_score > 1:
#         return True
#     return False
# 
# TMP_FOLDER = 'tmp'


from pulp import LpStatus, LpStatusOptimal
from pyDEA.core.utils.dea_utils import is_efficient, TMP_FOLDER
import pickle
import os
                DMU code to LP status (optimal, unbounded, etc).
            input_duals (dict of str to dict of str to double): dictionary
                that maps DMU code to another dictionary that maps input
                category name to value of dual variable.
            output_duals (dict of str to dict of str to double): dictionary
                that maps DMU code to another dictionary that maps output
                category name to value of dual variable.
            return_to_scale (dict of str to str): dictionary that maps DMU code
                to the return-to-scale of the DMU

        Args:
            input_data (InputData): object that stores input data.
    '''
    def __init__(self, input_data):

        global _solution_id
        _solution_id += 1
        self._solution_id = _solution_id
        self.orientation = ''
        self._input_data = input_data

        self.efficiency_scores = dict()
        self.lp_status = dict()
        self.input_duals = dict()
        self.output_duals = dict()
        self.return_to_scale = dict()
        for dmu_code in input_data.DMU_codes:
            self.input_duals[dmu_code] = dict()
            self.output_duals[dmu_code] = dict()


# Path: pyDEA/core/utils/dea_utils.py
# def is_efficient(efficiency_score, lambda_variable):
#     ''' Checks if dmu with given efficiency score and value of
#         lambda variable is efficient.
# 
#         Args:
#             efficiency_score (double): efficiency spyDEA.core.
#             lambda_variable (double): value of lambda variable corresponding
#                 to DMU under consideration.
# 
#         Returns:
#             bool: True if DMU is efficient, False otherwise.
# 
#         Example:
#             >>> is_efficient(1, 1)
#             True
#             >>> is_efficient(0.5, 0)
#             False
#             >>> is_efficient(0.9999999, 1)
#             True
#             >>> is_efficient(1.0000001, 1)
#             True
# 
#     '''
#     if efficiency_score == 1:
#         return True
#     if lambda_variable > ZERO_TOLERANCE:
#         return True
#     # it seems that lambda_variable is not ultimate indication of efficiency
#     if efficiency_score > 1:
#         return True
#     return False
# 
# TMP_FOLDER = 'tmp'


# Path: pyDEA/core/data_processing/solution.py
from pulp import LpStatus, LpStatusOptimal
from pyDEA.core.utils.dea_utils import is_efficient, TMP_FOLDER
import pickle
import os

                DMU code to LP status (optimal, unbounded, etc).
            input_duals (dict of str to dict of str to double): dictionary
                that maps DMU code to another dictionary that maps input
                category name to value of dual variable.
            output_duals (dict of str to dict of str to double): dictionary
                that maps DMU code to another dictionary that maps output
                category name to value of dual variable.
            return_to_scale (dict of str to str): dictionary that maps DMU code
                to the return-to-scale of the DMU

        Args:
            input_data (InputData): object that stores input data.
    '''
    def __init__(self, input_data):

        global _solution_id
        _solution_id += 1
        self._solution_id = _solution_id
        self.orientation = ''
        self._input_data = input_data

        self.efficiency_scores = dict()
        self.lp_status = dict()
        self.input_duals = dict()
        self.output_duals = dict()
        self.return_to_scale = dict()
        for dmu_code in input_data.DMU_codes:
            self.input_duals[dmu_code] = dict()
            self.output_duals[dmu_code] = dict()


        if not os.path.exists(TMP_FOLDER):