It's a convoluted way of defining those two constants.

```python
GIS_LOOKUPS = {
  'bbcontains', 'bboverlaps', 'contained', 'contains',
   ...
}
ALL_TERMS = GIS_LOOKUPS | QUERY_TERMS
```

Should do.