# Path: mlpy/auxiliary/misc.py
# def listify(obj):
#     """Ensure that the object `obj` is of type list.
# 
#     If the object is not of type `list`, the object is
#     converted into a list.
# 
#     Parameters
#     ----------
#     obj :
#         The object.
# 
#     Returns
#     -------
#     list :
#         The object inside a list.
# 
#     """
#     if obj is None:
#         return []
# 
#     return obj if isinstance(obj, (list, type(None))) else [obj]


import math
import numpy as np
from abc import ABCMeta, abstractmethod
from ...auxiliary.misc import listify
        if isinstance(value, (np.ndarray, list)):
            for v in value:
                if not isinstance(v, (int, long)):
                    raise ValueError("The feature value is not of type `integer`.")

    def compare(self, other):
        """Compare this feature to another feature.

        If the feature is represented by a list the similarity
        between the two features is determined by the Euclidean
        distance of the feature values.

        Parameters
        ----------
        other : Feature
            The other feature to compare this feature to.

        Returns
        -------
        float :
            The similarity metric.

        """
        if isinstance(self._value, (int, long)):
            return self.value - other.value

        assert len(self._value) == len(other.value), "Features don't match"

        total_similarity = 0.0


# Path: mlpy/auxiliary/misc.py
# def listify(obj):
#     """Ensure that the object `obj` is of type list.
# 
#     If the object is not of type `list`, the object is
#     converted into a list.
# 
#     Parameters
#     ----------
#     obj :
#         The object.
# 
#     Returns
#     -------
#     list :
#         The object inside a list.
# 
#     """
#     if obj is None:
#         return []
# 
#     return obj if isinstance(obj, (list, type(None))) else [obj]


# Path: mlpy/knowledgerep/cbr/features.py
import math
import numpy as np
from abc import ABCMeta, abstractmethod
from ...auxiliary.misc import listify

        if isinstance(value, (np.ndarray, list)):
            for v in value:
                if not isinstance(v, (int, long)):
                    raise ValueError("The feature value is not of type `integer`.")

    def compare(self, other):
        """Compare this feature to another feature.

        If the feature is represented by a list the similarity
        between the two features is determined by the Euclidean
        distance of the feature values.

        Parameters
        ----------
        other : Feature
            The other feature to compare this feature to.

        Returns
        -------
        float :
            The similarity metric.

        """
        if isinstance(self._value, (int, long)):
            return self.value - other.value

        assert len(self._value) == len(other.value), "Features don't match"

        total_similarity = 0.0


        for i, val in enumerate(listify(self._value)):