This file contains 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 pymatgen.core.structure import Composition | |
ds = [] | |
ds.append(dict(Mn=20, O=20)) | |
ds.append(dict(Fe=3, O=4)) | |
ds.append(dict(Li=2, Co=2, O=4)) | |
for d in ds: | |
c = Composition.from_dict(d) |
This file contains 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 os | |
import sys | |
import types | |
import logging | |
log = logging.getLogger(__name__) | |
def _setup_log(): | |
log.setLevel(logging.DEBUG) |
This file contains 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 sys | |
from bs4 import BeautifulSoup | |
html_file = sys.argv[1] | |
with open(html_file, 'r') as f: | |
s = BeautifulSoup(f) | |
print s.title.string | |
sys.exit(0) |
This file contains 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 setuptools import setup, Command | |
class GetVersion(Command): | |
"""This must be defined""" | |
user_options = [] | |
def initialize_options(self): | |
pass | |
This file contains 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 sys | |
try: | |
from setuptools import setup | |
except ImportError: | |
from distutils.core import setup | |
if ("install" in sys.argv) and sys.version_info < (2, 7, 0): | |
print "pbcore requires Python 2.7" | |
sys.exit(-1) |
This file contains 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
"""Example taken from Raymond Hettinger's Pycon 2013 talk""" | |
import sys | |
import os | |
from contextlib import contextmanager | |
_file_name = "Exampl3.fil3.tmp" | |
def terrible_example(): | |
"""Terrible. Race condition""" |
This file contains 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
# Use most recent gold build from SIV | |
function goldSeymour(){ | |
root=/mnt/secondary-siv/nightlytest/siv3 | |
changelist=`ls /home/UNIXHOME/secondarytest/gold_releases | sort -r | head -1 | egrep --only-match "^[0-9]*"` | |
seymour=${root}/smrtanalysis_${changelist} | |
if [ -d "${seymour}" ] | |
then | |
echo "Loading changelist ${changelist} with SEYMOUR_HOME=${seymour}" | |
export SEYMOUR_HOME=$seymour | |
source $SEYMOUR_HOME/etc/setup.sh |
This file contains 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 logging | |
import os | |
from pbsmrtpipe.resource_types import (MovieFofn, BarcodeFofn, BarcodeFasta, | |
MappingCmph5, BarcodeFastq) | |
from pbsmrtpipe.model import (TaskTypes, TaskBase, | |
TaskOption, TaskChoiceOption, | |
P_Module, TempDir) | |
log = logging.getLogger(__name__) |
This file contains 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 argparse | |
def get_parser(): | |
parser = argparse.ArgumentParser(version=__version__, | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
parser.add_argument('input_fofn', help="Path to bas.fofn", | |
type=validate_fofn) | |
return parser |
This file contains 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 abc | |
import functools | |
import logging | |
import warnings | |
import operator | |
log = logging.getLogger(__name__) | |
class RuleBase(object): |
OlderNewer