def submission_is_valid(submission):
    # check domain/extension validity, caches, and if previously commented
    ext = extension(submission.url)
    if (submission.domain in allowedDomains and ext not in disabled_extensions) or ext in allowed_extensions:
        # Check for submission id and url
        if previously_commented(submission):
            return False, True
        else:
            return True, False
    return False, False


# Process a gif post
dataset/ETHPy150Open hzsweers/gfy_mirror/gfy_mirror/bot.py/submission_is_valid/original