Skip to content

Instantly share code, notes, and snippets.

View restrepo's full-sized avatar

Diego Restrepo restrepo

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import re
def split_names(s,exceptions=['Gil', 'Lew', 'Liz', 'Paz', 'Rey', 'Rio', 'Roa', 'Rua', 'Sus', 'Zea'],
nacionality='Colombiana'):
"""
Extract the parts of the full name `s` in the format ([] → optional):
[SMALL_CONECTORS] FIRST_LAST_NAME [SMALL_CONECTORS] [SECOND_LAST_NAME] NAMES
If len(s) == 3 → Not Ibero-America name is asked
@article{Alloul:2013bka,
author = "Alloul, Adam and Christensen, Neil D. and Degrande,
Céline and Duhr, Claude and Fuks, Benjamin",
title = "{FeynRules 2.0 - A complete toolbox for tree-level
phenomenology}",
journal = "Comput. Phys. Commun.",
volume = "185",
year = "2014",
pages = "2250-2300",
doi = "10.1016/j.cpc.2014.04.012",
def get_institutions(q):
page=1
if q:
url=f'https://inspirehep.net/api/institutions?q={q}&size=250&page={page}'
else:
url=f'https://inspirehep.net/api/institutions?size=250&page={page}'
r=requests.get(url)
time.sleep(sleep)
i=r.json()['hits']['hits']
total=r.json().get('hits').get('total')