def parseRating(line):
    """
    Parses a rating record in MovieLens format userId::movieId::rating::count .
    """
    fields = line.strip().split("::")
    return int(fields[3]), (int(fields[0]), int(fields[1]), float(fields[2]))