def check_valid_metric_parameter(metric: str):
    """ Check parameter is either 'distance' or 'similarity'. """
    if metric != 'distance' and metric != 'similarity':
        raise ValueError(
            "Parameter 'metric' must be 'distance' or 'similarity'.Got: " +
            metric.__str__())
