## Bug description

strtobool is used in several places where it will cause deprecation warning in Pythin 3.10 and error in Python 3.12 since distutils will be removed in Python 3.12 .

Reference : https://www.python.org/dev/peps/pep-0632/

```
rg distutils                     
posthog/api/annotation.py
1:from distutils.util import strtobool

posthog/api/dashboard.py
2:from distutils.util import strtobool

posthog/api/insight.py
1:from distutils.util import strtobool

posthog/models/filters/mixins/common.py
4:from distutils.util import strtobool

posthog/settings.py
17:from distutils.util import strtobool
```

## Expected behavior

It's a good idea to vendor in the function as it's a short one.

## Environment

- [ ] PostHog Cloud
- [ ] self-hosted PostHog, version/commit: _please provide_


#### *Thank you* for your bug report – we love squashing them!

posthog/utils.py
start_date: Optional[datetime.datetime], end_date: Optional[datetime.datetime], frequency: str
) -> List[Any]:
    """
    Returns list of a fixed frequency Datetime objects between given bounds.
    Parameters:
        start_date: Left bound for generating dates.
        end_date: Right bound for generating dates.
        frequency: Possible options => minute, hour, day, week, month
    """
    delta = DATERANGE_MAP[frequency]
    if not start_date or not end_date:
        return []
    time_range = []
    if frequency != "minute" and frequency != "hour":
        start_date = start_date.replace(hour=0, minute=0, second=0, microsecond=0)
        end_date = end_date.replace(hour=0, minute=0, second=0, microsecond=0)
    if frequency == "week":
        start_date -= datetime.timedelta(days=start_date.weekday() + 1)
    if frequency != "month":
        while start_date <= end_date:
            time_range.append(start_date)
            start_date += delta
    else:
        if start_date.day != 1:
            start_date = (start_date.replace(day=1)).replace(day=1)
        while start_date <= end_date:
            time_range.append(start_date)
            start_date = (start_date.replace(day=1) + delta).replace(day=1)
    return time_range
def get_safe_cache(cache_key: str):