Skip to content

Instantly share code, notes, and snippets.

@BibMartin
Created February 25, 2016 10:49
Show Gist options
  • Select an option

  • Save BibMartin/3452f66261c633d19550 to your computer and use it in GitHub Desktop.

Select an option

Save BibMartin/3452f66261c633d19550 to your computer and use it in GitHub Desktop.
Test continuum repo consistency
import requests, re
import numpy as np
import pandas as pd
out = pd.Series([])
for i in range(10):
r = requests.get('https://repo.continuum.io/pkgs/free/linux-64/')
assert r.ok
libs = re.findall('<tr>\s*<td>.*?>(.*?)</a></td>', r.text, re.DOTALL)
assert len(libs) == len(re.findall('<tr>\s*<td>(.*?)</td>', r.text, re.DOTALL))
out = out.append(pd.Series(libs, index=[i]*len(libs)))
pb_list = (lambda x: np.sort(x[x<10].index.values).tolist())(out.value_counts())
print(out.value_counts().value_counts())
print '\n '.join(['-'*80]+pb_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment