# Path: ndlib/models/compartments/Compartment.py
# class Compartiment(object):
#     """
#     """
# 
#     def __init__(self, *args, **kwargs):
#         self.composed = None
#         if 'composed' in args[0]:
#             if isinstance(args[0]['composed'], Compartiment):
#                 self.composed = args[0]['composed']
# 
#     def execute(self, *args, **kwargs):
#         pass
# 
#     def compose(self, *args, **kwargs):
#         if self.composed is not None:
#             return self.composed.execute(*args, **kwargs)
#         else:
#             return True
# 
# Path: ndlib/models/compartments/enums/NumericalType.py
# class NumericalType(Enum):
#     STATUS = 0
#     ATTRIBUTE = 1


from ndlib.models.compartments.Compartment import Compartiment
from ndlib.models.compartments.enums.NumericalType import NumericalType
import networkx as nx
import numpy as np
import operator
        if self.variable_type is None:
            raise ValueError("A type must be provided for the variable")
        if not isinstance(self.variable_type, NumericalType):
            raise ValueError("The provided variable type is not valid")
        if self.value_type and not isinstance(self.value_type, NumericalType):
            raise ValueError("The provided value type is not valid")
        if self.value is None:
            raise ValueError("A value must be provided")

        if self.operator is not None and self.operator in self.__available_operators:
            if self.operator == "IN":
                if not isinstance(self.value, list) or \
                    not (isinstance(self.value[0], int) or isinstance(self.value[0], float)) or \
                    not (isinstance(self.value[1], int) or isinstance(self.value[1], float)) \
                    or self.value[1] < self.value[0]:
                    raise ValueError("A range list is required to test IN condition")
            else:
                if self.value_type is None:
                    if not isinstance(self.value, int):
                        if not isinstance(self.value, float):
                            raise ValueError("When no value type is defined, the value should be numerical")
                else:
                    if not isinstance(self.value, str):
                        raise ValueError("The value should be a string pointing to an attribute or status when value type is set")
        else:
            raise ValueError("The operator provided '%s' is not valid" % operator)

    def execute(self, node, graph, status, status_map, attributes=None, *args, **kwargs):
        if self.variable_type == NumericalType.STATUS:
            val = status[node][self.variable]

# Path: ndlib/models/compartments/Compartment.py
# class Compartiment(object):
#     """
#     """
# 
#     def __init__(self, *args, **kwargs):
#         self.composed = None
#         if 'composed' in args[0]:
#             if isinstance(args[0]['composed'], Compartiment):
#                 self.composed = args[0]['composed']
# 
#     def execute(self, *args, **kwargs):
#         pass
# 
#     def compose(self, *args, **kwargs):
#         if self.composed is not None:
#             return self.composed.execute(*args, **kwargs)
#         else:
#             return True
# 
# Path: ndlib/models/compartments/enums/NumericalType.py
# class NumericalType(Enum):
#     STATUS = 0
#     ATTRIBUTE = 1


# Path: ndlib/models/compartments/NodeNumericalVariable.py
from ndlib.models.compartments.Compartment import Compartiment
from ndlib.models.compartments.enums.NumericalType import NumericalType
import networkx as nx
import numpy as np
import operator

        if self.variable_type is None:
            raise ValueError("A type must be provided for the variable")
        if not isinstance(self.variable_type, NumericalType):
            raise ValueError("The provided variable type is not valid")
        if self.value_type and not isinstance(self.value_type, NumericalType):
            raise ValueError("The provided value type is not valid")
        if self.value is None:
            raise ValueError("A value must be provided")

        if self.operator is not None and self.operator in self.__available_operators:
            if self.operator == "IN":
                if not isinstance(self.value, list) or \
                    not (isinstance(self.value[0], int) or isinstance(self.value[0], float)) or \
                    not (isinstance(self.value[1], int) or isinstance(self.value[1], float)) \
                    or self.value[1] < self.value[0]:
                    raise ValueError("A range list is required to test IN condition")
            else:
                if self.value_type is None:
                    if not isinstance(self.value, int):
                        if not isinstance(self.value, float):
                            raise ValueError("When no value type is defined, the value should be numerical")
                else:
                    if not isinstance(self.value, str):
                        raise ValueError("The value should be a string pointing to an attribute or status when value type is set")
        else:
            raise ValueError("The operator provided '%s' is not valid" % operator)

    def execute(self, node, graph, status, status_map, attributes=None, *args, **kwargs):
        if self.variable_type == NumericalType.STATUS:
            val = status[node][self.variable]

        elif self.variable_type == NumericalType.ATTRIBUTE: