Skip to content

Instantly share code, notes, and snippets.

View mizvol's full-sized avatar
🦒
Focusing

Volodymyr Miz mizvol

🦒
Focusing
View GitHub Profile
sudo wget -O /etc/apt/sources.list.d/bigtop-1.3.0.list http://archive.apache.org/dist/bigtop/bigtop-1.3.0/repos/ubuntu16.04/bigtop.list
wget -O- http://archive.apache.org/dist/bigtop/bigtop-1.3.0/repos/GPG-KEY-bigtop | sudo apt-key add -
import numpy as np
choice1_count = 0
choice2_count = 0
for i in range(0,7000000):
random_choice = random.SystemRandom()
choice = random_choice.choice([1,2])
if choice == 1:
choice1_count += 1
else:
{"modelTopology": {"keras_version": "2.1.6-tf", "backend": "tensorflow", "model_config": {"class_name": "Sequential", "config": {"name": "sequential_1", "layers": [{"class_name": "Conv2D", "config": {"name": "conv2d", "trainable": true, "batch_input_shape": [null, 28, 28, 1], "dtype": "float32", "filters": 16, "kernel_size": [5, 5], "strides": [2, 2], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null, "dtype": "float32"}}, "bias_initializer": {"class_name": "Zeros", "config": {"dtype": "float32"}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d", "trainable": true, "dtype": "float32", "pool_size": [2, 2], "padding": "valid", "strides": [2, 2], "data_format": "channels_last"}}, {"class_name": "Conv2D", "config": {"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
degreesCount = g.degrees.count()
pr = g.pageRank(resetProbability = 0.15, tol=0.01)
from graphframes import *
vertices = sqlContext.createDataFrame(userIds, ["id"])
edges = sqlContext.createDataFrame(edgesList, ["src", "dst", "relationship"])
g = GraphFrame(vertices, edges)
import pymongo as pm
client = pm.MongoClient()
db = client.instagram
followerIds = db.followerIds
pipeline = [{"$unwind": "$follows"}]
relationships = list(followerIds.aggregate(pipeline))
userIds = list(followerIds.aggregate([{"$match": {"follows": {"$exists": True}}},{"$project": {"_id": 1}}]))
db.followers.aggregate({$project: {_id: 1}}).forEach(function(obj){
db.followerIds.insert(obj)
})
def getFullListOfFollowers(userId):
fullFollowersList = []
response = getFollowers(userId, '')
if response.get('data') == None:
print "Access denied"
return fullFollowersList
while(1):
fullFollowersList.extend(response.get('data'))