def is_ratelimit(tweet):
    """
    Returns True if the "tweet" is a rate-limit response.

    If False, then it should be an actual tweet.

    Works with raw tweet (as str) or de-JSONified tweet (as dict).

    """
    if isinstance(tweet, dict):
        # The tweet is a Python dictionary
        if 'limit' in tweet and 'track' in tweet['limit']:
            return True
        else:
            return False
    else:
        # The tweet is a raw text string.
        if tweet.startswith('{"limit":{"track"'):
            return True
        else:
            return False