Skip to content

Instantly share code, notes, and snippets.

View techwithshadab's full-sized avatar
💻
Playing with Data

Shadab Hussain techwithshadab

💻
Playing with Data
View GitHub Profile
gcloud compute --project=test-prj firewall-rules create mlflow-server --direction=INGRESS --priority=999 --network=default --action=ALLOW --rules=tcp:5000 --source-ranges=0.0.0.0/0 --target-tags=mlflow-server
mlflow server --backend-store-uri ./mlruns --default-artifact-root gs://mlflow_artifacts/artifacts --host 172.18.x.x
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'service_account.json'
from google.cloud import storage
client = storage.Client()
@techwithshadab
techwithshadab / elastic-net-wine.ipynb
Created March 17, 2020 23:13
Elastic Net Wine.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from github.MainClass import Github
import networkx as nx
import json
import matplotlib.pyplot as plt
def mount_graph(name_repo, graph):
nx.set_node_attributes(graph,'qt_contr',1)
list_repo = [name_repo]
g = Github('api_key') # Use your own api key here
with open('countries.json', 'r') as f:
data=f.read()
paises = json.loads(data)
try:
repo =g.get_repo(name_repo)
i = 0
This file has been truncated, but you can view the full file.
{
"Afghanistan": [
"Herat",
"Kabul",
"Kandahar",
"Molah",
"Rana",
"Shar",
"Sharif",
"Wazir Akbar Khan"
def plot_save(repo_name):
name = repo_name.split("/")[-1]
plt.figure(figsize = (30,30))
graph = nx.Graph()
graph = mount_graph(repo_name, graph)
pos = nx.spring_layout(graph, scale=3)
n = graph.number_of_nodes()
nx.draw(graph, pos, node_size=40000, node_color=range(n), with_labels=True, font_size=20, font_weight='bold', cmap=plt.cm.Blues)
nx.write_graphml(graph, name+"_countries.graphml")
@techwithshadab
techwithshadab / top-countries-contribution-pygithub.ipynb
Created April 6, 2020 00:14
Top Countries Contribution (PyGithub).ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.