def experiment_type(filename):
    """
    Get a experiment type from a file name.

    Assuming that filename is the path to a file name as
    measurements_<experiment_type>.csv, get the experiment type.

    :param filename: The name of the file (it can be full path).
    :raise: AssertionError if <filename> is not a string
    :return: A string representing the experiment type.
    """
    assert(isinstance(filename, str))
    exp_type = filename.split('/')[-1].split('.')[-2].split('_')[1:-1]
    exp_type = '_'.join(exp_type)
    return exp_type