@staticmethod
def type_error(var, data_types):
    """
        Raise a TypeError exception
        :param var:
        :param data_types: data types expected as strings
        :return:
        """
    from optimus.helpers.debug import get_var_name
    if len(data_types) == 1:
        divisor = ''
    elif len(data_types) == 2:
        divisor = ' or '
    elif len(data_types) > 2:
        divisor = ', '
    _type = divisor.join(map(lambda x: "'" + x + "'", data_types))
    raise TypeError(
        "'{var_name}' must be of type {type}, received '{var_type}'".format
        (var_name=get_var_name(var), type=_type, var_type=type(var)))
