Update compat.py

import datetime : unused
from urllib.parse import urlencode : double importded
from urllib import urlencode : double imported