def get_single(x, name):
    """Make sure only a single element is used
    """
    if isinstance(x, list):
        if len(x) == 1:
            return x[0]
        else:
            raise ValueError('Only a single {} can be used with --singularity'
                .format(name))
    else:
        return x
