def __init__(self): self.mongoClient = mongoDBUtils() self.db = self.mongoClient.db self.tweetIdTextCollection = self.mongoClient.tweetIdTextCollection self.tweetIdStatusCollection = self.mongoClient.tweetIdStatusCollection self.tweetIdScoreCollection = self.mongoClient.tweetIdScoreCollection self.twitterKeysCollection = self.mongoClient.twitterKeysCollection
def __init__(self): self.mongoClient = mongoDBUtils() self.db = self.mongoClient.db self.tweetIdTextCollection = self.mongoClient.tweetIdTextCollection self.tweetIdClassifiedTrainedCollection = self.mongoClient.tweetIdClassifiedTrainedCollection self.tweetIdClassifyCollection = self.mongoClient.tweetIdClassifyCollection self.twitterKeysCollection = self.mongoClient.twitterKeysCollection
def __init__(self, counter): self.mongoClient = mongoDBUtils() self.db = self.mongoClient.db self.tweetIdTextCollection = self.mongoClient.tweetIdTextCollection self.tweetIdStatusCollection = self.mongoClient.tweetIdStatusCollection self.tweetIdScoreCollection = self.mongoClient.tweetIdScoreCollection self.model = "models/model/model.h5" self.counter = counter K.clear_session() for i in range(20): gc.collect()
p = 0 for y in lines: x = y[:-1] if (p == 0): consumer_keys.append(x) elif (p == 1): consumer_secrets.append(x) elif (p == 2): access_tokens.append(x) elif (p == 3): access_token_secrets.append(x) p = (p + 1) % 4 client = mongoDBUtils() db = client.db twitterKeysCollection = client.twitterKeysCollection endTime2 = time.time() + 86400 endTime2 = datetime.datetime.fromtimestamp(endTime2, None) for x in range(0, len(consumer_keys)): paramDict = {} paramDict["consumer_key"] = consumer_keys[x] paramDict["consumer_secret"] = consumer_secrets[x] paramDict["access_token"] = access_tokens[x] paramDict["access_token_secret"] = access_token_secrets[x] paramDict["TTL"] = endTime2 lastUsedTime = time.time()