wrong condition in `Features ClassLabel encode_example`
{'login': 'Tudyx', 'id': 56633664, 'node_id': 'MDQ6VXNlcjU2NjMzNjY0', 'avatar_url': 'https://avatars.githubusercontent.com/u/56633664?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/Tudyx', 'html_url': 'https://github.com/Tudyx', 'followers_url': 'https://api.github.com/users/Tudyx/followers', 'following_url': 'https://api.github.com/users/Tudyx/following{/other_user}', 'gists_url': 'https://api.github.com/users/Tudyx/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/Tudyx/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/Tudyx/subscriptions', 'organizations_url': 'https://api.github.com/users/Tudyx/orgs', 'repos_url': 'https://api.github.com/users/Tudyx/repos', 'events_url': 'https://api.github.com/users/Tudyx/events{/privacy}', 'received_events_url': 'https://api.github.com/users/Tudyx/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892857, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODU3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/bug', 'name': 'bug', 'color': 'd73a4a', 'default': True, 'description': "Something isn't working"}]
[]
Hi @Tudyx, 

Please note that in Python, the boolean NOT operator (`not`) has lower precedence than comparison operators (`<=`, `<`), thus the expression you mention is equivalent to:
```python
 not (-1 <= example_data < self.num_classes)
```

Also note that as expected, the exception is raised if:
- `example_data < -1`
- or `example_data >= self.num_classes`

The raise of the exception is expected when `example_data` equals 4 and `self.num_classes` equals 4 too.
## Describe the bug

The `encode_example` function in *features.py* seems to have a wrong condition.

```python
if not -1 <= example_data < self.num_classes:
    raise ValueError(f"Class label {example_data:d} greater than configured num_classes {self.num_classes}")
```

## Expected results

The `not - 1` condition change the result of the condition. For instance, if  `example_data`  equals 4 and ` self.num_classes` equals 4 too, `example_data < self.num_classes` will give `False` as expected  . But if i add the  `not - 1`  condition, `not -1 <= example_data < self.num_classes` will give `True` and raise an exception.

## Environment info

- `datasets` version: 1.18.3
- Python version: 3.8.10
- PyArrow version: 7.00

{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3717/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}