# Path: hub_toolbox/io.py
# def check_vector_matrix_shape_fits_labels(X:np.ndarray, classes:np.ndarray):
#     """ Check the number of points in vector matrix equal number of labels."""
#     check_is_nD_array(X, 2, "Data vectors")
#     check_is_nD_array(classes, 1, "Class label")
#     if classes.size != X.shape[0]:
#         raise TypeError("Number of class labels does not match number of "
#                         "points. Labels: {}, points: {}."
#                         .format(classes.size, X.shape[0]))
# 
# Path: hub_toolbox/htlogging.py
# class ConsoleLogging(Logging):
#     """Convenience functions for time-stamped logging to the console"""
# 
#     def message(self, *objs, flush=True):
#         """Log normal program function"""
#         print(self._current_time, 'INFO:', *objs)
#         if flush:
#             sys.stdout.flush()
# 
#     def warning(self, *objs, flush=True):
#         """Log warning (program can still continue)"""
#         print(self._current_time, 'WARNING:', *objs, file=sys.stderr)
#         if flush:
#             sys.stderr.flush()
# 
#     def error(self, *objs, flush=True):
#         """Log error (program fails)"""
#         print(self._current_time, 'ERROR:', *objs, file=sys.stderr)
#         if flush:
#             sys.stderr.flush()


import ctypes
import numpy as np
from multiprocessing import Pool, cpu_count, RawArray
from scipy.spatial.distance import cdist, pdist, squareform
    from sklearn.model_selection import StratifiedShuffleSplit
    from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.metrics.pairwise import pairwise_distances
from hub_toolbox.io import check_vector_matrix_shape_fits_labels
from hub_toolbox.htlogging import ConsoleLogging

    n_jobs : int, optional, default: 1
        Parallel computation with multiple processes.

    verbose : int, optional, default: 0
        Increasing level of output

    Returns
    -------
    D : ndarray, shape (X.shape[0], Y.shape[0])
        m_p dissimilarity matrix

    References
    ----------
    .. [1] Aryal et al. (2017). Data-dependent dissimilarity measure: an
           effective alternative to geometric distance measures.
           Knowledge and Information Systems, Springer-Verlag London.
    """
    # Some preparation
    n_x, d = X.shape
    # All-against-all in X, or X against Y?
    if Y is None:
        Y = X
    n_y, d_y = Y.shape
    # X and Y must have same dimensionality
    assert d == d_y
    if n_jobs == -1:
        n_jobs = cpu_count()
    n_bins = int(n_bins)
    if p == 0:

# Path: hub_toolbox/io.py
# def check_vector_matrix_shape_fits_labels(X:np.ndarray, classes:np.ndarray):
#     """ Check the number of points in vector matrix equal number of labels."""
#     check_is_nD_array(X, 2, "Data vectors")
#     check_is_nD_array(classes, 1, "Class label")
#     if classes.size != X.shape[0]:
#         raise TypeError("Number of class labels does not match number of "
#                         "points. Labels: {}, points: {}."
#                         .format(classes.size, X.shape[0]))
# 
# Path: hub_toolbox/htlogging.py
# class ConsoleLogging(Logging):
#     """Convenience functions for time-stamped logging to the console"""
# 
#     def message(self, *objs, flush=True):
#         """Log normal program function"""
#         print(self._current_time, 'INFO:', *objs)
#         if flush:
#             sys.stdout.flush()
# 
#     def warning(self, *objs, flush=True):
#         """Log warning (program can still continue)"""
#         print(self._current_time, 'WARNING:', *objs, file=sys.stderr)
#         if flush:
#             sys.stderr.flush()
# 
#     def error(self, *objs, flush=True):
#         """Log error (program fails)"""
#         print(self._current_time, 'ERROR:', *objs, file=sys.stderr)
#         if flush:
#             sys.stderr.flush()


# Path: hub_toolbox/distances.py
import ctypes
import numpy as np
from multiprocessing import Pool, cpu_count, RawArray
from scipy.spatial.distance import cdist, pdist, squareform
    from sklearn.model_selection import StratifiedShuffleSplit
    from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.metrics.pairwise import pairwise_distances
from hub_toolbox.io import check_vector_matrix_shape_fits_labels
from hub_toolbox.htlogging import ConsoleLogging


    n_jobs : int, optional, default: 1
        Parallel computation with multiple processes.

    verbose : int, optional, default: 0
        Increasing level of output

    Returns
    -------
    D : ndarray, shape (X.shape[0], Y.shape[0])
        m_p dissimilarity matrix

    References
    ----------
    .. [1] Aryal et al. (2017). Data-dependent dissimilarity measure: an
           effective alternative to geometric distance measures.
           Knowledge and Information Systems, Springer-Verlag London.
    """
    # Some preparation
    n_x, d = X.shape
    # All-against-all in X, or X against Y?
    if Y is None:
        Y = X
    n_y, d_y = Y.shape
    # X and Y must have same dimensionality
    assert d == d_y
    if n_jobs == -1:
        n_jobs = cpu_count()
    n_bins = int(n_bins)
    if p == 0:

        log = ConsoleLogging()