def extract_ratelimit(headers_dict):
    """Returns rate limit dict, extracted from full headers."""
    return {
        "used": int(headers_dict.get("X-RateLimit-Used", 0)),
        "expire": float(headers_dict.get("X-RateLimit-Expire", 0)),
        "limit": int(headers_dict.get("X-RateLimit-Limit", 0)),
        "remain": int(headers_dict.get("X-RateLimit-Remaining", 0)),
    }