A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
import os | |
import argparse | |
import nibabel as nib | |
from nibabel.streamlines import Field | |
from nibabel.orientations import aff2axcodes | |
def build_argparser(): | |
DESCRIPTION = "Convert tractograms (TCK -> TRK)." |
import os | |
import argparse | |
import nibabel as nib | |
def build_argparser(): | |
DESCRIPTION = "Convert tractograms (TRK -> TCK)." | |
p = argparse.ArgumentParser(description=DESCRIPTION) | |
p.add_argument('tractograms', metavar='bundle', nargs="+", help='list of tractograms.') | |
p.add_argument('-f', '--force', action="store_true", help='overwrite existing output files.') |
import QtQuick 2.3 | |
import Renderer 1.0 | |
Item { | |
width: 500 | |
height: 600 | |
FBORenderer{ | |
id: fboRenderItem | |
anchors.fill: parent |
#!/usr/bin/env python | |
import argparse | |
import sys | |
import jinja2 | |
import markdown | |
TEMPLATE = """<!DOCTYPE html> | |
<html> |
Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.
cherry-pick
does support a range of commits, but if you have merge commits in that range, it gets really complicated
git checkout branch-B
git cherry-pick X
git cherry-pick Y
#!/usr/bin/env python | |
""" | |
===================================== | |
PEP 20 (The Zen of Python) by example | |
===================================== | |
Usage: %prog | |
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com |
# see https://www.youtube.com/watch?v=CsFpVdgEXCU for details of what this does | |
from typing import List | |
from langchain import ConversationChain | |
from langchain.chat_models import ChatOpenAI | |
from langchain.indexes.vectorstore import VectorStoreIndexWrapper | |
from langchain.memory import ConversationBufferMemory | |
from langchain.prompts import ( | |
ChatPromptTemplate, |