usage: make_github_changelog.py [-h] --token TOKEN [--since-tag SINCE_TAG] [--base BASE]
Helper for writing changelogs
optional arguments:
-h, --help show this help message and exit
--token TOKEN, -t TOKEN
GitHub API token
--since-tag SINCE_TAG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pretty-printers for mpark.variant based on those for libstdc++. | |
# Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def moduleinit(): | |
"""Make sure various environment variables are set correctly | |
""" | |
if 'MODULE_VERSION' not in os.environ: | |
os.environ['MODULE_VERSION_STACK'] = '3.2.10' | |
os.environ['MODULE_VERSION'] = '3.2.10' | |
else: | |
os.environ['MODULE_VERSION_STACK'] = os.environ['MODULE_VERSION'] | |
os.environ['MODULESHOME'] = '/usr/share/Modules/3.2.10' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.etree.ElementTree import Element, SubElement | |
from xml.etree import ElementTree | |
from xml.dom import minidom | |
def prettify(elem): | |
"""Return a pretty-printed XML string for the Element. | |
""" | |
rough_string = ElementTree.tostring(elem, 'utf-8') | |
reparsed = minidom.parseString(rough_string) | |
return reparsed.toprettyxml(indent=" ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def build_graph(files,exclude=['hdf5','h5lt','mpi']): | |
"""Build a dot graph of the Fortran modules in a list of files, | |
excluding modules named in the list exclude""" | |
# Start the graph | |
graph = "digraph G {\n" | |
deps = {} | |
p = re.compile("^(?:module|program) ([a-zA-Z0-9_]*)", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun insert-f90-namelist (name) | |
"Insert a new f90 namelist" | |
(interactive "sNamelist name: ") | |
(insert (format "/&%s" name)) | |
(funcall f90-auto-keyword-case -1) | |
(insert "\n\n/") | |
(previous-line)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "zoopla_houses_notebook" | |
}, | |
"name": "zoopla_houses_notebook", | |
"nbformat": 2, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import urllib2 | |
import numpy as np | |
from BeautifulSoup import BeautifulSoup | |
house_webpage = 'http://www.zoopla.co.uk/for-sale/details/28121543' | |
# Grab the whole webpage for the house listing | |
soup = BeautifulSoup(urllib2.urlopen(house_webpage).read()) |