def reqany(container, first, *options):
    """ If the first option is set, at least one of the others is required. """
    if first is not None and container.get(first) is None:
        return
    for option in options:
        if container.get(option) is not None:
            return
    if first is None:
        raise ValueError('one of this option is required: %s' % ', '.join(
            options))
    raise ValueError('option %s requires one of: %s' % (first, ', '.join(
        options)))
