code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
"""A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | [
[
8,
0,
0.0962,
0.1731,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2115,
0.0192,
0,
0.66,
0.5,
172,
0,
0,
0,
0,
0,
6,
0
],
[
2,
0,
0.625,
0.7692,
0,
0.66,
... | [
"\"\"\"A collection of modules for iterating through different kinds of\ntree, generating tokens identical to those produced by the tokenizer\nmodule.\n\nTo create a tree walker for a new type of tree, you need to do\nimplement a tree walker object (called TreeWalker by convention) that\nimplements a 'serialize' me... |
import re
import gettext
_ = gettext.gettext
from BeautifulSoup import BeautifulSoup, Declaration, Comment, Tag
from html5lib.constants import namespaces
import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
doctype_regexp = re.compile(
r'(?P<name>[^\s]*)(\s*PUBLIC\s*"(?P<publicId>.*)"\s*"(?P<syste... | [
[
1,
0,
0.0169,
0.0169,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0339,
0.0169,
0,
0.66,
0.1667,
723,
0,
1,
0,
0,
723,
0,
0
],
[
14,
0,
0.0508,
0.0169,
0,
... | [
"import re",
"import gettext",
"_ = gettext.gettext",
"from BeautifulSoup import BeautifulSoup, Declaration, Comment, Tag",
"from html5lib.constants import namespaces",
"import _base",
"class TreeWalker(_base.NonRecursiveTreeWalker):\n doctype_regexp = re.compile(\n r'(?P<name>[^\\s]*)(\\s*PUB... |
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from genshi.output import NamespaceFlattener
import _base
from html5lib.constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
de... | [
[
1,
0,
0.0143,
0.0143,
0,
0.66,
0,
987,
0,
5,
0,
0,
987,
0,
0
],
[
1,
0,
0.0286,
0.0143,
0,
0.66,
0.2,
987,
0,
6,
0,
0,
987,
0,
0
],
[
1,
0,
0.0429,
0.0143,
0,
0.6... | [
"from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT",
"from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT",
"from genshi.output import NamespaceFlattener",
"import _base",
"from html5lib.constants import voidElements",
"class TreeWalker(_base.TreeWalker):\n de... |
import re
from xml.sax.saxutils import escape, unescape
from tokenizer import HTMLTokenizer
from constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area', 'b',
... | [
[
1,
0,
0.0043,
0.0043,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0087,
0.0043,
0,
0.66,
0.2,
759,
0,
2,
0,
0,
759,
0,
0
],
[
1,
0,
0.0174,
0.0043,
0,
0.6... | [
"import re",
"from xml.sax.saxutils import escape, unescape",
"from tokenizer import HTMLTokenizer",
"from constants import tokenTypes",
"class HTMLSanitizerMixin(object):\n \"\"\" sanitization of XHTML+MathML+SVG and of inline style attributes.\"\"\"\n\n acceptable_elements = ['a', 'abbr', 'acronym',... |
import string, gettext
_ = gettext.gettext
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import Set as set
from sets import ImmutableSet as frozenset
EOF = None
E = {
"null-character":
_(u"Null character in input stream, replaced with U+FFFD."),
... | [
[
1,
0,
0.0009,
0.0009,
0,
0.66,
0,
890,
0,
2,
0,
0,
890,
0,
0
],
[
14,
0,
0.0017,
0.0009,
0,
0.66,
0.0323,
660,
7,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.0056,
0.0051,
0,
0... | [
"import string, gettext",
"_ = gettext.gettext",
"try:\n frozenset\nexcept NameError:\n # Import from the sets module for python 2.3\n from sets import Set as set\n from sets import ImmutableSet as frozenset",
" frozenset",
" from sets import Set as set",
" from sets import ImmutableS... |
class Filter(object):
def __init__(self, source):
self.source = source
def __iter__(self):
return iter(self.source)
def __getattr__(self, name):
return getattr(self.source, name)
| [
[
3,
0,
0.6,
0.9,
0,
0.66,
0,
813,
0,
3,
0,
0,
186,
0,
2
],
[
2,
1,
0.35,
0.2,
1,
0.82,
0,
555,
0,
2,
0,
0,
0,
0,
0
],
[
14,
2,
0.4,
0.1,
2,
0.57,
0,
848,
... | [
"class Filter(object):\n def __init__(self, source):\n self.source = source\n\n def __iter__(self):\n return iter(self.source)\n\n def __getattr__(self, name):",
" def __init__(self, source):\n self.source = source",
" self.source = source",
" def __iter__(self):\n ... |
#
# The goal is to finally have a form filler where you pass data for
# each form, using the algorithm for "Seeding a form with initial values"
# See http://www.whatwg.org/specs/web-forms/current-work/#seeding
#
import _base
from html5lib.constants import spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
c... | [
[
1,
0,
0.0551,
0.0079,
0,
0.66,
0,
464,
0,
1,
0,
0,
464,
0,
0
],
[
1,
0,
0.0709,
0.0079,
0,
0.66,
0.3333,
970,
0,
1,
0,
0,
970,
0,
0
],
[
14,
0,
0.0787,
0.0079,
0,
... | [
"import _base",
"from html5lib.constants import spaceCharacters",
"spaceCharacters = u\"\".join(spaceCharacters)",
"class SimpleFilter(_base.Filter):\n def __init__(self, source, fieldStorage):\n _base.Filter.__init__(self, source)\n self.fieldStorage = fieldStorage\n\n def __iter__(self):... |
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import ImmutableSet as frozenset
import re
import _base
from html5lib.constants import rcdataElements, spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
SPACES_REGEX = re.compile(u"[%s]+" % spaceCharacters)
... | [
[
7,
0,
0.0732,
0.122,
0,
0.66,
0,
0,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.0488,
0.0244,
1,
0.48,
0,
0,
2,
0,
0,
0,
0,
0,
0
],
[
1,
1,
0.122,
0.0244,
1,
0.48,
0,
... | [
"try:\n frozenset\nexcept NameError:\n # Import from the sets module for python 2.3\n from sets import ImmutableSet as frozenset",
" frozenset",
" from sets import ImmutableSet as frozenset",
"import re",
"import _base",
"from html5lib.constants import rcdataElements, spaceCharacters",
"s... |
import _base
from html5lib.sanitizer import HTMLSanitizerMixin
class Filter(_base.Filter, HTMLSanitizerMixin):
def __iter__(self):
for token in _base.Filter.__iter__(self):
token = self.sanitize_token(token)
if token: yield token
| [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
464,
0,
1,
0,
0,
464,
0,
0
],
[
1,
0,
0.25,
0.125,
0,
0.66,
0.5,
689,
0,
1,
0,
0,
689,
0,
0
],
[
3,
0,
0.75,
0.625,
0,
0.66,
1... | [
"import _base",
"from html5lib.sanitizer import HTMLSanitizerMixin",
"class Filter(_base.Filter, HTMLSanitizerMixin):\n def __iter__(self):\n for token in _base.Filter.__iter__(self):\n token = self.sanitize_token(token)\n if token: yield token",
" def __iter__(self):\n ... |
from gettext import gettext
_ = gettext
import _base
from html5lib.constants import cdataElements, rcdataElements, voidElements
from html5lib.constants import spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
class LintError(Exception): pass
class Filter(_base.Filter):
def __iter__(self):
open... | [
[
1,
0,
0.0114,
0.0114,
0,
0.66,
0,
723,
0,
1,
0,
0,
723,
0,
0
],
[
14,
0,
0.0227,
0.0114,
0,
0.66,
0.1429,
660,
2,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0455,
0.0114,
0,
0... | [
"from gettext import gettext",
"_ = gettext",
"import _base",
"from html5lib.constants import cdataElements, rcdataElements, voidElements",
"from html5lib.constants import spaceCharacters",
"spaceCharacters = u\"\".join(spaceCharacters)",
"class LintError(Exception): pass",
"class Filter(_base.Filter)... |
import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.encoding is None)
pending = []
for token in _base.Filter.__iter... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
464,
0,
1,
0,
0,
464,
0,
0
],
[
3,
0,
0.5238,
0.9683,
0,
0.66,
1,
813,
0,
2,
0,
0,
362,
0,
12
],
[
2,
1,
0.0794,
0.0476,
1,
0.64... | [
"import _base",
"class Filter(_base.Filter):\n def __init__(self, source, encoding):\n _base.Filter.__init__(self, source)\n self.encoding = encoding\n\n def __iter__(self):\n state = \"pre_head\"\n meta_found = (self.encoding is None)",
" def __init__(self, source, encoding... |
import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 = previous1
previous1 = token
yield previous2, previous... | [
[
1,
0,
0.005,
0.005,
0,
0.66,
0,
464,
0,
1,
0,
0,
464,
0,
0
],
[
3,
0,
0.5074,
0.9901,
0,
0.66,
1,
813,
0,
4,
0,
0,
362,
0,
3
],
[
2,
1,
0.0371,
0.0396,
1,
0.45,
... | [
"import _base",
"class Filter(_base.Filter):\n def slider(self):\n previous1 = previous2 = None\n for token in self.source:\n if previous1 is not None:\n yield previous2, previous1, token\n previous2 = previous1\n previous1 = token",
" def slid... |
"""
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = h... | [
[
8,
0,
0.3824,
0.7059,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7647,
0.0588,
0,
0.66,
0.2,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.8235,
0.0588,
0,
0.66,
... | [
"\"\"\" \nHTML parsing library based on the WHATWG \"HTML5\"\nspecification. The parser is designed to be compatible with existing\nHTML found in the wild and implements well-defined error recovery that\nis largely compatible with modern desktop web browsers.\n\nExample usage:",
"__version__ = \"0.90\"",
"from ... |
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import Set as set
from sets import ImmutableSet as frozenset
try:
from collections import deque
except ImportError:
from utils import deque
from constants import contentModelFlags, spaceCharacters
from c... | [
[
7,
0,
0.0029,
0.005,
0,
0.66,
0,
0,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.0017,
0.0008,
1,
0.68,
0,
0,
2,
0,
0,
0,
0,
0,
0
],
[
1,
1,
0.0041,
0.0008,
1,
0.68,
0,
... | [
"try:\n frozenset\nexcept NameError:\n # Import from the sets module for python 2.3\n from sets import Set as set\n from sets import ImmutableSet as frozenset",
" frozenset",
" from sets import Set as set",
" from sets import ImmutableSet as frozenset",
"try:\n from collections impor... |
from html5lib.constants import scopingElements, tableInsertModeElements, namespaces
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import Set as set
from sets import ImmutableSet as frozenset
# The scope markers are inserted when entering buttons, object element... | [
[
1,
0,
0.0029,
0.0029,
0,
0.66,
0,
970,
0,
3,
0,
0,
970,
0,
0
],
[
7,
0,
0.013,
0.0174,
0,
0.66,
0.25,
0,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.0087,
0.0029,
1,
0.61,
... | [
"from html5lib.constants import scopingElements, tableInsertModeElements, namespaces",
"try:\n frozenset\nexcept NameError:\n # Import from the sets module for python 2.3\n from sets import Set as set\n from sets import ImmutableSet as frozenset",
" frozenset",
" from sets import Set as set"... |
import new
import re
import _base
from html5lib import ihatexml
from html5lib import constants
from html5lib.constants import namespaces
tag_regexp = re.compile("{([^}]*)}(.*)")
moduleCache = {}
def getETreeModule(ElementTreeImplementation, fullTree=False):
name = "_" + ElementTreeImplementation.__name__+"build... | [
[
1,
0,
0.003,
0.003,
0,
0.66,
0,
145,
0,
1,
0,
0,
145,
0,
0
],
[
1,
0,
0.0061,
0.003,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0122,
0.003,
0,
0.66... | [
"import new",
"import re",
"import _base",
"from html5lib import ihatexml",
"from html5lib import constants",
"from html5lib.constants import namespaces",
"tag_regexp = re.compile(\"{([^}]*)}(.*)\")",
"moduleCache = {}",
"def getETreeModule(ElementTreeImplementation, fullTree=False):\n name = \"_... |
import _base
from html5lib.constants import voidElements, namespaces, prefixes
from xml.sax.saxutils import escape
# Really crappy basic implementation of a DOM-core like thing
class Node(_base.Node):
type = -1
def __init__(self, name):
self.name = name
self.parent = None
self.value = N... | [
[
1,
0,
0.004,
0.004,
0,
0.66,
0,
464,
0,
1,
0,
0,
464,
0,
0
],
[
1,
0,
0.0081,
0.004,
0,
0.66,
0.1,
970,
0,
3,
0,
0,
970,
0,
0
],
[
1,
0,
0.0121,
0.004,
0,
0.66,
... | [
"import _base",
"from html5lib.constants import voidElements, namespaces, prefixes",
"from xml.sax.saxutils import escape",
"class Node(_base.Node):\n type = -1\n def __init__(self, name):\n self.name = name\n self.parent = None\n self.value = None\n self.childNodes = []\n ... |
"""A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | [
[
8,
0,
0.1739,
0.337,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3587,
0.0109,
0,
0.66,
0.5,
163,
0,
0,
0,
0,
0,
6,
0
],
[
2,
0,
0.6902,
0.6304,
0,
0.66,
... | [
"\"\"\"A collection of modules for building different kinds of tree from\nHTML documents.\n\nTo create a treebuilder for a new type of tree, you need to do\nimplement several things:\n\n1) A set of classes for various types of elements: Document, Doctype,\nComment, Element. These must implement the interface of",
... |
import warnings
warnings.warn("BeautifulSoup 3.x (as of 3.1) is not fully compatible with html5lib and support will be removed in the future", DeprecationWarning)
from BeautifulSoup import BeautifulSoup, Tag, NavigableString, Comment, Declaration
import _base
from html5lib.constants import namespaces, DataLossWarnin... | [
[
1,
0,
0.0044,
0.0044,
0,
0.66,
0,
358,
0,
1,
0,
0,
358,
0,
0
],
[
8,
0,
0.0132,
0.0044,
0,
0.66,
0.1111,
960,
3,
2,
0,
0,
0,
0,
1
],
[
1,
0,
0.0219,
0.0044,
0,
0.... | [
"import warnings",
"warnings.warn(\"BeautifulSoup 3.x (as of 3.1) is not fully compatible with html5lib and support will be removed in the future\", DeprecationWarning)",
"from BeautifulSoup import BeautifulSoup, Tag, NavigableString, Comment, Declaration",
"import _base",
"from html5lib.constants import na... |
import new
import warnings
import re
import _base
from html5lib.constants import DataLossWarning
import html5lib.constants as constants
import etree as etree_builders
from html5lib import ihatexml
try:
import lxml.etree as etree
except ImportError:
pass
fullTree = True
"""Module for supporting the lxml.etre... | [
[
1,
0,
0.003,
0.003,
0,
0.66,
0,
145,
0,
1,
0,
0,
145,
0,
0
],
[
1,
0,
0.006,
0.003,
0,
0.66,
0.0667,
358,
0,
1,
0,
0,
358,
0,
0
],
[
1,
0,
0.009,
0.003,
0,
0.66,
... | [
"import new",
"import warnings",
"import re",
"import _base",
"from html5lib.constants import DataLossWarning",
"import html5lib.constants as constants",
"import etree as etree_builders",
"from html5lib import ihatexml",
"try:\n import lxml.etree as etree\nexcept ImportError:\n pass",
" i... |
'''
Created on 21-03-2011
@author: maciek
'''
from formater import formatString
import os
class IndexGenerator(object):
'''
Generates Index.html for iOS app OTA distribution
'''
basePath = os.path.dirname(__file__)
templateFile = os.path.join(basePath,"templates/index.tmpl")
releaseUrls = ""
... | [
[
8,
0,
0.0526,
0.0877,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1053,
0.0175,
0,
0.66,
0.3333,
11,
0,
1,
0,
0,
11,
0,
0
],
[
1,
0,
0.1228,
0.0175,
0,
0.66,
... | [
"'''\nCreated on 21-03-2011\n\n@author: maciek\n'''",
"from formater import formatString",
"import os",
"class IndexGenerator(object):\n '''\n Generates Index.html for iOS app OTA distribution\n '''\n basePath = os.path.dirname(__file__)\n templateFile = os.path.join(basePath,\"templates/index.... |
'''
Created on 21-03-2011
@author: maciek
'''
def formatString(format, **kwargs):
'''
'''
if not format: return ''
for arg in kwargs.keys():
format = format.replace("{" + arg + "}", "##" + arg + "##")
format = format.replace ("{", "{{")
format = format.replace("}", "}}")
for... | [
[
8,
0,
0.1304,
0.2174,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.6739,
0.6957,
0,
0.66,
1,
798,
0,
2,
1,
0,
0,
0,
9
],
[
8,
1,
0.413,
0.087,
1,
0.13,
0,
... | [
"'''\nCreated on 21-03-2011\n\n@author: maciek\n'''",
"def formatString(format, **kwargs):\n '''\n '''\n if not format: return ''\n \n for arg in kwargs.keys():\n format = format.replace(\"{\" + arg + \"}\", \"##\" + arg + \"##\")\n format = format.replace (\"{\", \"{{\")",
" '''\n ... |
'''
Created on 21-03-2011
@author: maciek
'''
from IndexGenerator import IndexGenerator
from optparse import OptionParser
import os
import tempfile
import shutil
import logging
logging.basicConfig(level = logging.DEBUG)
parser = OptionParser()
parser.add_option('-n', '--app-name', action='store', dest='appName', hel... | [
[
8,
0,
0.0341,
0.0568,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0682,
0.0114,
0,
0.66,
0.0303,
933,
0,
1,
0,
0,
933,
0,
0
],
[
1,
0,
0.0795,
0.0114,
0,
0.66... | [
"'''\nCreated on 21-03-2011\n\n@author: maciek\n'''",
"from IndexGenerator import IndexGenerator",
"from optparse import OptionParser",
"import os",
"import tempfile",
"import shutil",
"import logging",
"logging.basicConfig(level = logging.DEBUG)",
"parser = OptionParser()",
"parser.add_option('-n... |
#!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | [
[
8,
0,
0.0156,
0.0256,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0293,
0.0018,
0,
0.66,
0.0244,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0311,
0.0018,
0,
0.66... | [
"\"\"\"Bootstrap distribute installation\n\nIf you want to use setuptools in your package's setup.py, just include this\nfile in the same directory with it, and add this to the top of your setup.py::\n\n from distribute_setup import use_setuptools\n use_setuptools()",
"import os",
"import shutil",
"impo... |
# pysam versioning information
__version__ = "0.7.4"
__samtools_version__ = "0.1.18"
__tabix_version__ = "0.2.6"
| [
[
14,
0,
0.4286,
0.1429,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.7143,
0.1429,
0,
0.66,
0.5,
20,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
0.1429,
0,
0.66,
... | [
"__version__ = \"0.7.4\"",
"__samtools_version__ = \"0.1.18\"",
"__tabix_version__ = \"0.2.6\""
] |
from pysam.csamtools import *
from pysam.ctabix import *
import pysam.csamtools as csamtools
import pysam.ctabix as ctabix
from pysam.cvcf import *
import pysam.cvcf as cvcf
import pysam.Pileup as Pileup
import sys
import os
class SamtoolsError( Exception ):
'''exception raised in case of an error incurred in the ... | [
[
1,
0,
0.0071,
0.0071,
0,
0.66,
0,
288,
0,
1,
0,
0,
288,
0,
0
],
[
1,
0,
0.0142,
0.0071,
0,
0.66,
0.0625,
506,
0,
1,
0,
0,
506,
0,
0
],
[
1,
0,
0.0213,
0.0071,
0,
... | [
"from pysam.csamtools import *",
"from pysam.ctabix import *",
"import pysam.csamtools as csamtools",
"import pysam.ctabix as ctabix",
"from pysam.cvcf import *",
"import pysam.cvcf as cvcf",
"import pysam.Pileup as Pileup",
"import sys",
"import os",
"class SamtoolsError( Exception ):\n '''exc... |
'''Tools for working with files in the samtools pileup -c format.'''
import collections
import pysam
PileupSubstitution = collections.namedtuple( "PileupSubstitution",
" ".join( (\
"chromosome",
"pos",
"reference_base",
"genotype",
... | [
[
8,
0,
0.0037,
0.0037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0074,
0.0037,
0,
0.66,
0.0833,
193,
0,
1,
0,
0,
193,
0,
0
],
[
1,
0,
0.0111,
0.0037,
0,
0.66... | [
"'''Tools for working with files in the samtools pileup -c format.'''",
"import collections",
"import pysam",
"PileupSubstitution = collections.namedtuple( \"PileupSubstitution\",\n \" \".join( (\\\n \"chromosome\", \n \"pos\", \n \"reference... |
#!/usr/bin/python
'''
pysam
*****
'''
import os, sys, glob, shutil, hashlib, re, fnmatch
import platform
name = "pysam"
# collect pysam version
sys.path.insert( 0, "pysam")
import version
version = version.__version__
samtools_exclude = ( "bamtk.c", "razip.c", "bgzip.c",
"main.c", "calDepth... | [
[
8,
0,
0.0179,
0.0239,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0359,
0.004,
0,
0.66,
0.0385,
688,
0,
7,
0,
0,
688,
0,
0
],
[
1,
0,
0.0398,
0.004,
0,
0.66,
... | [
"'''\n\npysam\n*****\n\n'''",
"import os, sys, glob, shutil, hashlib, re, fnmatch",
"import platform",
"name = \"pysam\"",
"sys.path.insert( 0, \"pysam\")",
"import version",
"version = version.__version__",
"samtools_exclude = ( \"bamtk.c\", \"razip.c\", \"bgzip.c\", \n \"main.c\"... |
'''benchmark pysam BAM/SAM access with the samtools commandline tools.
samtools functions are called via the pysam interface to avoid the over-head
of starting additional processes.
'''
import pysam
import timeit
iterations = 10
def runBenchmark( test,
pysam_way,
samtools_way =... | [
[
8,
0,
0.0476,
0.0794,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1111,
0.0159,
0,
0.66,
0.1111,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.127,
0.0159,
0,
0.66,... | [
"'''benchmark pysam BAM/SAM access with the samtools commandline tools.\n\nsamtools functions are called via the pysam interface to avoid the over-head\nof starting additional processes.\n'''",
"import pysam",
"import timeit",
"iterations = 10",
"def runBenchmark( test, \n pysam_way,\n ... |
'''test script for checking if compilation against
pysam and tabix works.'''
import pyximport
pyximport.install( build_in_temp=False)
import _compile_test
| [
[
8,
0,
0.25,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6667,
0.1667,
0,
0.66,
0.3333,
732,
0,
1,
0,
0,
732,
0,
0
],
[
8,
0,
0.8333,
0.1667,
0,
0.66,
... | [
"'''test script for checking if compilation against\npysam and tabix works.'''",
"import pyximport",
"pyximport.install( build_in_temp=False)",
"import _compile_test"
] |
#!/usr/bin/env python
'''unit testing code for pysam.
Execute in the :file:`tests` directory as it requires the Makefile
and data files located there.
'''
import pysam
import unittest
import os, re, sys
import itertools
import collections
import subprocess
import shutil
import logging
IS_PYTHON3 = sys.version_info[0... | [
[
8,
0,
0.0023,
0.0028,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0045,
0.0006,
0,
0.66,
0.0204,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.0051,
0.0006,
0,
0.66... | [
"'''unit testing code for pysam.\n\nExecute in the :file:`tests` directory as it requires the Makefile\nand data files located there.\n'''",
"import pysam",
"import unittest",
"import os, re, sys",
"import itertools",
"import collections",
"import subprocess",
"import shutil",
"import logging",
"I... |
#!/usr/bin/env python
'''unit testing code for pysam.
Execute in the :file:`tests` directory as it requires the Makefile
and data files located there.
'''
import pysam
import unittest
import os, re, sys
import itertools
import collections
import subprocess
import shutil
import logging
if sys.version_info[0] < 3:
... | [
[
8,
0,
0.0025,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.005,
0.0006,
0,
0.66,
0.0238,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.0056,
0.0006,
0,
0.66,... | [
"'''unit testing code for pysam.\n\nExecute in the :file:`tests` directory as it requires the Makefile\nand data files located there.\n'''",
"import pysam",
"import unittest",
"import os, re, sys",
"import itertools",
"import collections",
"import subprocess",
"import shutil",
"import logging",
"i... |
import pp
import pysam
def sortBam(bam_filepath, out_prefix):
pysam.sort(bam_filepath, out_prefix)
job_server = pp.Server(ncpus=2, ppservers = (), secret='secret')
job1 = job_server.submit(sortBam, ('ex1.bam', 'tmp1_'), modules=('pysam',))
job2 = job_server.submit(sortBam, ('ex2.bam', 'tmp2_'), modules=('pysam',... | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
632,
0,
1,
0,
0,
632,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.1429,
878,
0,
1,
0,
0,
878,
0,
0
],
[
2,
0,
0.3462,
0.1538,
0,
... | [
"import pp",
"import pysam",
"def sortBam(bam_filepath, out_prefix):\n pysam.sort(bam_filepath, out_prefix)",
" pysam.sort(bam_filepath, out_prefix)",
"job_server = pp.Server(ncpus=2, ppservers = (), secret='secret')",
"job1 = job_server.submit(sortBam, ('ex1.bam', 'tmp1_'), modules=('pysam',))",
... |
#!/usr/bin/env python
'''unit testing code for pysam.
Execute in the :file:`tests` directory as it requires the Makefile
and data files located there.
'''
import sys, os, shutil, gzip
import pysam
import unittest
import itertools
import subprocess
class TestVCFIterator( unittest.TestCase ):
filename = "example.... | [
[
8,
0,
0.0325,
0.0407,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.065,
0.0081,
0,
0.66,
0.125,
509,
0,
4,
0,
0,
509,
0,
0
],
[
1,
0,
0.0732,
0.0081,
0,
0.66,
... | [
"'''unit testing code for pysam.\n\nExecute in the :file:`tests` directory as it requires the Makefile\nand data files located there.\n'''",
"import sys, os, shutil, gzip",
"import pysam",
"import unittest",
"import itertools",
"import subprocess",
"class TestVCFIterator( unittest.TestCase ):\n\n fil... |
#!/usr/bin/env python
'''unit testing code for pysam.
Execute in the :file:`tests` directory as it requires the Makefile
and data files located there.
'''
import sys, os, shutil, gzip
import pysam
import unittest
import itertools
import subprocess
import glob
import re
IS_PYTHON3 = sys.version_info[0] >= 3
def myzi... | [
[
8,
0,
0.0068,
0.0085,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0137,
0.0017,
0,
0.66,
0.0417,
509,
0,
4,
0,
0,
509,
0,
0
],
[
1,
0,
0.0154,
0.0017,
0,
0.66... | [
"'''unit testing code for pysam.\n\nExecute in the :file:`tests` directory as it requires the Makefile\nand data files located there.\n'''",
"import sys, os, shutil, gzip",
"import pysam",
"import unittest",
"import itertools",
"import subprocess",
"import glob",
"import re",
"IS_PYTHON3 = sys.versi... |
# usage: cat pysam_ex1.bam | python pysam_test_stdin.pyx
import pysam
samfile = pysam.Samfile( "-", "rb" )
# set up the modifying iterators
l = list(samfile.fetch( until_eof = True ))
assert len(l) == 3270
| [
[
1,
0,
0.3,
0.1,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
14,
0,
0.5,
0.1,
0,
0.66,
0.5,
834,
3,
2,
0,
0,
12,
10,
1
],
[
14,
0,
0.8,
0.1,
0,
0.66,
1,
81... | [
"import pysam",
"samfile = pysam.Samfile( \"-\", \"rb\" )",
"l = list(samfile.fetch( until_eof = True ))"
] |
#!/usr/bin/env python
'''unit testing code for pysam.'''
import pysam
import unittest
import os
import itertools
import subprocess
import shutil
class TestExceptions(unittest.TestCase):
def setUp(self):
self.samfile=pysam.Samfile( "ex1.bam","rb" )
def testOutOfRangeNegativeNewFormat(self):
s... | [
[
8,
0,
0.0541,
0.027,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1081,
0.027,
0,
0.66,
0.125,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.1351,
0.027,
0,
0.66,
... | [
"'''unit testing code for pysam.'''",
"import pysam",
"import unittest",
"import os",
"import itertools",
"import subprocess",
"import shutil",
"class TestExceptions(unittest.TestCase):\n\n def setUp(self):\n self.samfile=pysam.Samfile( \"ex1.bam\",\"rb\" )\n\n def testOutOfRangeNegativeN... |
raise ImportError( '''calling "import pysam" from the source directory is not supported - please import pysam from somewhere else.''')
| [] | [] |
# -*- coding: utf-8 -*-
"""
This file is part of COMMANDino.
COMMANDino 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.
COMMANDino is distr... | [
[
8,
0,
0.0848,
0.1429,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1696,
0.0089,
0,
0.66,
0.1429,
847,
0,
1,
0,
0,
847,
0,
0
],
[
1,
0,
0.1786,
0.0089,
0,
0.66... | [
"\"\"\"\nThis file is part of COMMANDino.\n\nCOMMANDino is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.",
"from commandino import en... |
# -*- coding: utf-8 -*-
"""
This file is part of COMMANDino.
COMMANDino 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.
COMMANDino is distr... | [
[
8,
0,
0.0856,
0.1441,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1712,
0.009,
0,
0.66,
0.2,
614,
0,
3,
0,
0,
614,
0,
0
],
[
1,
0,
0.1802,
0.009,
0,
0.66,
... | [
"\"\"\"\nThis file is part of COMMANDino.\n\nCOMMANDino is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.",
"import urllib,re,time",
... |
# -*- coding: utf-8 -*-
"""
This file is part of COMMANDino.
COMMANDino 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.
COMMANDino is distr... | [
[
8,
0,
0.1105,
0.186,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2209,
0.0116,
0,
0.66,
0.25,
847,
0,
1,
0,
0,
847,
0,
0
],
[
1,
0,
0.2326,
0.0116,
0,
0.66,
... | [
"\"\"\"\nThis file is part of COMMANDino.\n\nCOMMANDino is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.",
"from commandino import en... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.0398,
0.002,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.0417,
0.002,
0,
0.66,
0.25,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.0437,
0.002,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"class SimpleDB(AWSService):\n\tendpoints = {\n\t\t'us-east-1': 'sdb.amazonaws.com',\n\t\t'us-west-1': 'sdb.us-west-1.amazonaws.com',\n\t\t'eu-west-1': 'sdb.eu-west-1.amazonaws.com',\n\t\t'... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.0364,
0.0018,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.0383,
0.0018,
0,
0.66,
0.2,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.0401,
0.0018,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"from urlparse import urlparse",
"class SNS(AWSService):\n\tendpoints = {\n\t\t'us-east-1': 'sns.us-east-1.amazonaws.com',\n\t\t'us-west-1': 'sns.us-west-1.amazonaws.com',\n\t\t'eu-west-1... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.0435,
0.0022,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.0457,
0.0022,
0,
0.66,
0.2,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.0478,
0.0022,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"from urlparse import urlparse",
"class CloudWatch(AWSService):\n\tendpoints = {\n\t\t'us-east-1': 'monitoring.us-east-1.amazonaws.com',\n\t\t'us-west-1': 'monitoring.us-west-1.amazonaws.... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.0749,
0.0037,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.0787,
0.0037,
0,
0.66,
0.0833,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.0824,
0.0037,
0,
0.66... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"from urlparse import urlparse",
"import urllib",
"import time",
"import hmac",
"import hashlib",
"import base64",
"import httplib",
"class Route53Request(request.AWSRequest):... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.2644,
0.0115,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.2759,
0.0115,
0,
0.66,
0.3333,
50,
0,
1,
0,
0,
50,
0,
0
],
[
3,
0,
0.5862,
0.5632,
0,
0.66... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"class ExampleService(AWSService):\n\tendpoints = {\n\t\t'localhost': 'localhost:8080',\n\t}\n\txmlns = 'http://aaws.code.google.com/doc/2010-06-30/'\n\tversion = '2011-06-30'\n\n\tdef __init__(self, region, key, secret, version=None)... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
3,
0,
0.4918,
0.3115,
0,
0.66,
0,
915,
0,
3,
0,
0,
186,
0,
8
],
[
14,
1,
0.3607,
0.0164,
1,
0.11,
0,
387,
1,
0,
0,
0,
0,
4,
0
],
[
2,
1,
0.4754,
0.1803,
1,
0.11,
... | [
"class ServiceProxy(object):\n\t_is_proxy = True\n\n\tdef __init__(self, service):\n\t\tif hasattr(service, '_is_proxy'):\n\t\t\tself._service = service._service\n\t\telse:\n\t\t\tself._service = service",
"\t_is_proxy = True",
"\tdef __init__(self, service):\n\t\tif hasattr(service, '_is_proxy'):\n\t\t\tself._... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.2348,
0.0087,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.2435,
0.0087,
0,
0.66,
0.2,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.2522,
0.0087,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"from urlparse import urlparse",
"class EC2(AWSService):\n\tendpoints = {\n\t\t'us-east-1': 'ec2.us-east-1.amazonaws.com',\n\t\t'us-west-1': 'ec2.us-west-1.amazonaws.com',\n\t\t'eu-west-1... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.1238,
0.0048,
0,
0.66,
0,
801,
0,
2,
0,
0,
801,
0,
0
],
[
1,
0,
0.1286,
0.0048,
0,
0.66,
0.0833,
857,
0,
1,
0,
0,
857,
0,
0
],
[
1,
0,
0.1333,
0.0048,
0,
... | [
"from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer",
"import urlparse",
"import cgi",
"import aws",
"from formencode import validators, Schema, Invalid, ForEach, variabledecode",
"import request",
"import urllib",
"import hmac",
"import hashlib",
"import base64",
"class ServiceReques... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.2041,
0.0102,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.2143,
0.0102,
0,
0.66,
0.2,
9,
0,
1,
0,
0,
9,
0,
0
],
[
1,
0,
0.2245,
0.0102,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import uuid",
"import json",
"from urlparse import urlparse",
"def SubscribeQueue(sqs, sns, queueName, topicName):\n\tqueue = sqs.CreateQueue(queueName).GET()\n\ttopic = sns.CreateTopic(topicName).GET()\n\tp = urlparse(queue)\n\tattr = sqs.GetQueu... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.0483,
0.0024,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.0507,
0.0024,
0,
0.66,
0.2,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.0531,
0.0024,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"from urlparse import urlparse",
"class SQS(AWSService):\n\tendpoints = {\n\t\t'us-east-1': 'sqs.us-east-1.amazonaws.com',\n\t\t'us-west-1': 'sqs.us-west-1.amazonaws.com',\n\t\t'eu-west-1... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.0876,
0.003,
0,
0.66,
0,
21,
0,
3,
0,
0,
21,
0,
0
],
[
1,
0,
0.0906,
0.003,
0,
0.66,
0.0714,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.0937,
0.003,
0,
0.66,
... | [
"from aws import AWSService, AWSError, getBotoCredentials",
"import request",
"from xml.etree import ElementTree as ET",
"from urlparse import urlparse",
"import time",
"import hmac",
"import hashlib",
"import base64",
"import urllib",
"import os",
"import StringIO",
"import mimetools",
"cla... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.6667,
0.0333,
0,
0.66,
0,
916,
0,
2,
0,
0,
916,
0,
0
],
[
1,
0,
0.7,
0.0333,
0,
0.66,
0.1111,
50,
0,
2,
0,
0,
50,
0,
0
],
[
1,
0,
0.7333,
0.0333,
0,
0.66,... | [
"from proxy import ServiceProxy, ManagerProxy",
"from request import AWSRequestManager, AWSRequest",
"from aws import AWSService, AWSError, getBotoCredentials",
"from sqs import SQS",
"from sns import SNS",
"from ec2 import EC2",
"from s3 import S3",
"from route53 import Route53",
"from simpledb imp... |
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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.
#
# AAWS... | [
[
1,
0,
0.253,
0.012,
0,
0.66,
0,
50,
0,
1,
0,
0,
50,
0,
0
],
[
1,
0,
0.2651,
0.012,
0,
0.66,
0.125,
601,
0,
1,
0,
0,
601,
0,
0
],
[
1,
0,
0.2771,
0.012,
0,
0.66,
... | [
"import request",
"from xml.etree import ElementTree as ET",
"import os.path",
"def getBotoCredentials():\n\timport ConfigParser\n\tconfigParser = ConfigParser.ConfigParser()\n\tpth = os.path.expanduser('~/.boto')\n\tif not os.path.exists(pth):\n\t\tpth = '/etc/boto.cfg'\n\tconfigParser.read(pth)\n\tkey = con... |
#!/usr/bin/env python
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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 l... | [
[
1,
0,
0.2283,
0.0109,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2391,
0.0109,
0,
0.66,
0.1429,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.25,
0.0109,
0,
0.... | [
"import sys",
"import optparse",
"import subprocess",
"import os",
"sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..')))",
"import aaws",
"def ec2ssh(ec2, kws, iid, options):\n\tdef lower(s):\n\t\tif s is None:\n\t\t\treturn None\n\t\treturn s.lower()\n\tconnectTo = None\n\tfor i in ec2.De... |
#!/usr/bin/env python
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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 l... | [
[
1,
0,
0.0743,
0.0031,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0774,
0.0031,
0,
0.66,
0.0625,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0805,
0.0031,
0,
... | [
"import sys",
"import os",
"import optparse",
"import subprocess",
"sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..')))",
"import aaws",
"def getData(dns):\n\tzones = dns.ListHostedZones()\n\tfor key in zones.keys():\n\t\tzoneId = zones[key]['Id']\n\t\trrs = dns.ListResourceRecordSets(zon... |
import sys
sys.path.append('..')
import aaws
import optparse
import subprocess
import os
import os.path
import time
KB = 1024
MB = 1024 * KB
GB = 1024 * MB
class Meter(object):
def __init__(self, fname):
border = '[' + (' ' * 50) + '] ' + fname
sys.stderr.write(border)
sys.stderr.write('\x08' * (len(border)... | [
[
1,
0,
0.0108,
0.0054,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0162,
0.0054,
0,
0.66,
0.0526,
243,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.0216,
0.0054,
0,
0.... | [
"import sys",
"sys.path.append('..')",
"import aaws",
"import optparse",
"import subprocess",
"import os",
"import os.path",
"import time",
"KB = 1024",
"MB = 1024 * KB",
"GB = 1024 * MB",
"class Meter(object):\n\n\tdef __init__(self, fname):\n\t\tborder = '[' + (' ' * 50) + '] ' + fname\n\t\t... |
#!/usr/bin/env python
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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 l... | [
[
1,
0,
0.25,
0.0114,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2614,
0.0114,
0,
0.66,
0.1111,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.2727,
0.0114,
0,
0.... | [
"import sys",
"import optparse",
"import subprocess",
"import os",
"import time",
"sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..')))",
"import aaws",
"def findHost(rrs, host):\n\tfor name, typ, ttl, values in rrs:\n\t\tif name == host and typ == 'A':\n\t\t\treturn (name, typ, ttl, val... |
#!/usr/bin/env python
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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 l... | [
[
1,
0,
0.0743,
0.0031,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0774,
0.0031,
0,
0.66,
0.0625,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0805,
0.0031,
0,
... | [
"import sys",
"import os",
"import optparse",
"import subprocess",
"sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..')))",
"import aaws",
"def getData(dns):\n\tzones = dns.ListHostedZones()\n\tfor key in zones.keys():\n\t\tzoneId = zones[key]['Id']\n\t\trrs = dns.ListResourceRecordSets(zon... |
#!/usr/bin/env python
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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 l... | [
[
1,
0,
0.25,
0.0114,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2614,
0.0114,
0,
0.66,
0.1111,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.2727,
0.0114,
0,
0.... | [
"import sys",
"import optparse",
"import subprocess",
"import os",
"import time",
"sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..')))",
"import aaws",
"def findHost(rrs, host):\n\tfor name, typ, ttl, values in rrs:\n\t\tif name == host and typ == 'A':\n\t\t\treturn (name, typ, ttl, val... |
#!/usr/bin/env python
#
# Copyright 2011 Snitch Incorporated
#
# This file is part of AAWS.
#
# AAWS 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 l... | [
[
1,
0,
0.2283,
0.0109,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2391,
0.0109,
0,
0.66,
0.1429,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.25,
0.0109,
0,
0.... | [
"import sys",
"import optparse",
"import subprocess",
"import os",
"sys.path.append(os.path.normpath(os.path.join(sys.path[0], '..')))",
"import aaws",
"def ec2ssh(ec2, kws, iid, options):\n\tdef lower(s):\n\t\tif s is None:\n\t\t\treturn None\n\t\treturn s.lower()\n\tconnectTo = None\n\tfor i in ec2.De... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
[
1,
0,
0.3542,
0.0208,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.375,
0.0208,
0,
0.66,
0.1429,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3958,
0.0208,
0,
0... | [
"import sys",
"import os",
"from StringIO import StringIO",
"from PIL import Image",
"import datauri",
"def image_to_data_uri_(im):\n f = StringIO()\n im.save(f, 'PNG')\n uri = datauri.to_data_uri(f.getvalue(), 'foo.png')\n f.close()\n return uri",
" f = StringIO()",
" im.save(f, 'PNG')",
" ... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
[
1,
0,
0.5,
0.0294,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.5294,
0.0294,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5588,
0.0294,
0,
0.66,
... | [
"import base64",
"import sys",
"import mimetypes",
"def to_data_uri(data, file_name):\n '''Takes a file object and returns its data: string.'''\n mime_type = mimetypes.guess_type(file_name)\n return 'data:%(mimetype)s;base64,%(data)s' % dict(mimetype=mime_type[0],\n data=base64.b64encode(data))",
" ... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
[
1,
0,
0.1753,
0.0103,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1856,
0.0103,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1959,
0.0103,
0,
0.6... | [
"import sys",
"import os",
"from StringIO import StringIO",
"from PIL import Image",
"import datauri",
"RGBA_BLACK = (0, 0, 0, 255)",
"sign_ = lambda n: -1 if n < 0 else (1 if n > 0 else 0)",
"def find_black_region_(im, sx, sy, ex, ey):\n dx = sign_(ex - sx)\n dy = sign_(ey - sy)\n if abs(dx) == ab... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
[
1,
0,
0.2881,
0.0169,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3051,
0.0169,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.322,
0.0169,
0,
0... | [
"import sys",
"import os",
"import os.path",
"import shutil",
"import zipfile",
"def main():\n params = {}\n params['id'] = sys.argv[1]\n params['displayname'] = sys.argv[2]\n params['description'] = sys.argv[3]\n\n zip_file = zipfile.ZipFile('dist/stencil-%s.zip' % params['id'], 'w',\n zipfile.... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.15,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
#!/usr/bin/python
# by Aaron (ams@bio.aau.dk)
# version 0.5
######################################
# Version History
# v. 0.1 started with the Genbank parser for CDS
# v. 0.2 wrote the arguement parser
# v. 0.3 wrote the proteinsearch function
# v. 0.4 cds parser completed. Added a log file for the cds parser
# v. 0.5 ... | [
[
1,
0,
0.1453,
0.0058,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1512,
0.0058,
0,
0.66,
0.0909,
631,
0,
1,
0,
0,
631,
0,
0
],
[
1,
0,
0.157,
0.0058,
0,
0... | [
"import sys",
"from Bio import SeqIO",
"from Bio.Blast import NCBIWWW",
"from Bio.Blast import NCBIXML",
"from Bio import Entrez",
"Entrez.email = 'ams@bio.aau.dk'",
"import re",
"import os",
"from time import localtime, strftime",
"def parse_cds(gp_records, outdir):\n \"\"\" \n Returns a list o... |
#!/usr/bin/python
# by Aaron (ams@bio.aau.dk)
########## Import functions ###########
import sys
"""
Docstring...
blah blah
"""
############## Functions ###############
# def FunctionName(argument1, argument2, ...):
# """ Optional Function description (Docstring) """
# +++ FUNCTION CODE +++
... | [
[
1,
0,
0.1304,
0.0217,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.25,
0.1304,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.7826,
0.4565,
0,
0.66,
... | [
"import sys",
"\"\"\"\nDocstring...\n\nblah blah\n\n\"\"\"",
"def main():\n # # This command-line parsing code is provided.\n # # Make a list of command line arguments, omitting the [0] element\n # # which is the script itself.\n # args = sys.argv[1:]\n\n # if not args:\n # print 'usage: [--summaryfile]... |
#!/usr/bin/python
# by Aaron (ams@bio.aau.dk)
# version 0.5
######################################
# Version History
# v. 0.1 started with the Genbank parser for CDS
# v. 0.2 wrote the arguement parser
# v. 0.3 wrote the proteinsearch function
# v. 0.4 cds parser completed. Added a log file for the cds parser
# v. 0.5 ... | [
[
1,
0,
0.1453,
0.0058,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1512,
0.0058,
0,
0.66,
0.0909,
631,
0,
1,
0,
0,
631,
0,
0
],
[
1,
0,
0.157,
0.0058,
0,
0... | [
"import sys",
"from Bio import SeqIO",
"from Bio.Blast import NCBIWWW",
"from Bio.Blast import NCBIXML",
"from Bio import Entrez",
"Entrez.email = 'ams@bio.aau.dk'",
"import re",
"import os",
"from time import localtime, strftime",
"def parse_cds(gp_records, outdir):\n \"\"\" \n Returns a list o... |
#!/usr/bin/python
# by Aaron (ams@bio.aau.dk)
########## Import functions ###########
import sys
"""
Docstring...
blah blah
"""
############## Functions ###############
# def FunctionName(argument1, argument2, ...):
# """ Optional Function description (Docstring) """
# +++ FUNCTION CODE +++
... | [
[
1,
0,
0.1304,
0.0217,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.25,
0.1304,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.7826,
0.4565,
0,
0.66,
... | [
"import sys",
"\"\"\"\nDocstring...\n\nblah blah\n\n\"\"\"",
"def main():\n # # This command-line parsing code is provided.\n # # Make a list of command line arguments, omitting the [0] element\n # # which is the script itself.\n # args = sys.argv[1:]\n\n # if not args:\n # print 'usage: [--summaryfile]... |
#!/usr/bin/python
# Aaron Saunders | ams@bio.aau.dk
import sys
import re
args = sys.argv[1:]
fastafilename = args[0]
ucfilename = args[1]
with open(ucfilename, 'r') as fh:
clusters = [ line for line in fh if line.startswith('S') ]
ucmap = { }
for line in clusters:
data = line.rstrip().split... | [
[
1,
0,
0.1316,
0.0263,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1579,
0.0263,
0,
0.66,
0.0833,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.2105,
0.0263,
0,
... | [
"import sys",
"import re",
"args = sys.argv[1:]",
"fastafilename = args[0]",
"ucfilename = args[1]",
" clusters = [ line for line in fh if line.startswith('S') ]",
"ucmap = { }",
"for line in clusters:\n data = line.rstrip().split('\\t')\n clusternumber, clustername = data[1], data[8]\n uc... |
#!/usr/bin/python
import phrap
import os
import subprocess
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
import shutil
from Bio import SeqIO
import sys
"""
This script is a wrapper for the functions in the phrap.py module.
"""
args = sys.argv[1:]
infilepath = args[0]
rootpath = args[1]
####################... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
411,
0,
1,
0,
0,
411,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.0227,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
... | [
"import phrap",
"import os",
"import subprocess",
"from Bio.Seq import Seq",
"from Bio.Alphabet import IUPAC",
"import shutil",
"from Bio import SeqIO",
"import sys",
"\"\"\"\nThis script is a wrapper for the functions in the phrap.py module.\n\n\"\"\"",
"args = sys.argv[1:]",
"infilepath = args... |
#!/usr/bin/python
# Aaron Saunders | ams@bio.aau.dk
import sys
from Bio import SeqIO
from Bio.SeqUtils.CheckSum import seguid
import matplotlib.pyplot as plt
import pickle
infname = sys.argv[1]
outfilestub = sys.argv[2]
reps = {}
counts = {}
uniquebuffer = []
uniquefname = outfilestub + '.unique.fastq'
uniquefile = ... | [
[
1,
0,
0.1026,
0.0256,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1282,
0.0256,
0,
0.66,
0.0556,
631,
0,
1,
0,
0,
631,
0,
0
],
[
1,
0,
0.1538,
0.0256,
0,
... | [
"import sys",
"from Bio import SeqIO",
"from Bio.SeqUtils.CheckSum import seguid",
"import matplotlib.pyplot as plt",
"import pickle",
"infname = sys.argv[1]",
"outfilestub = sys.argv[2]",
"reps = {}",
"counts = {}",
"uniquebuffer = []",
"uniquefname = outfilestub + '.unique.fastq'",
"uniquefi... |
#!/usr/bin/python
# Aaron Saunders | ams@bio.aau.dk
import sys
import re
args = sys.argv[1:]
fastafilename = args[0]
ucfilename = args[1]
with open(ucfilename, 'r') as fh:
clusters = [ line for line in fh if line.startswith('S') ]
ucmap = { }
for line in clusters:
data = line.rstrip().split... | [
[
1,
0,
0.1316,
0.0263,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1579,
0.0263,
0,
0.66,
0.0833,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.2105,
0.0263,
0,
... | [
"import sys",
"import re",
"args = sys.argv[1:]",
"fastafilename = args[0]",
"ucfilename = args[1]",
" clusters = [ line for line in fh if line.startswith('S') ]",
"ucmap = { }",
"for line in clusters:\n data = line.rstrip().split('\\t')\n clusternumber, clustername = data[1], data[8]\n uc... |
#!/usr/bin/python
import phrap
import os
import subprocess
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
import shutil
from Bio import SeqIO
import sys
"""
This script is a wrapper for the functions in the phrap.py module.
"""
args = sys.argv[1:]
infilepath = args[0]
rootpath = args[1]
####################... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
411,
0,
1,
0,
0,
411,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.0227,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
... | [
"import phrap",
"import os",
"import subprocess",
"from Bio.Seq import Seq",
"from Bio.Alphabet import IUPAC",
"import shutil",
"from Bio import SeqIO",
"import sys",
"\"\"\"\nThis script is a wrapper for the functions in the phrap.py module.\n\n\"\"\"",
"args = sys.argv[1:]",
"infilepath = args... |
#!/usr/bin/python
# Aaron Saunders | ams@bio.aau.dk
import sys
from Bio import SeqIO
from Bio.SeqUtils.CheckSum import seguid
import matplotlib.pyplot as plt
import pickle
infname = sys.argv[1]
outfilestub = sys.argv[2]
reps = {}
counts = {}
uniquebuffer = []
uniquefname = outfilestub + '.unique.fastq'
uniquefile = ... | [
[
1,
0,
0.1026,
0.0256,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1282,
0.0256,
0,
0.66,
0.0556,
631,
0,
1,
0,
0,
631,
0,
0
],
[
1,
0,
0.1538,
0.0256,
0,
... | [
"import sys",
"from Bio import SeqIO",
"from Bio.SeqUtils.CheckSum import seguid",
"import matplotlib.pyplot as plt",
"import pickle",
"infname = sys.argv[1]",
"outfilestub = sys.argv[2]",
"reps = {}",
"counts = {}",
"uniquebuffer = []",
"uniquefname = outfilestub + '.unique.fastq'",
"uniquefi... |
#!/usr/bin/python
import time
from math import sqrt, ceil
def isprime(num):
ans = True
for n in xrange(2, int(ceil(sqrt(num)))+1):
if num % n == 0:
ans = False
break
return ans
def main():
""" What is the 10 001st prime number?"""
start = time.time()
prime = 1... | [
[
1,
0,
0.0882,
0.0294,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.1176,
0.0294,
0,
0.66,
0.25,
526,
0,
2,
0,
0,
526,
0,
0
],
[
2,
0,
0.2794,
0.2353,
0,
0.... | [
"import time",
"from math import sqrt, ceil",
"def isprime(num):\n ans = True\n for n in xrange(2, int(ceil(sqrt(num)))+1):\n if num % n == 0:\n ans = False\n break\n\n return ans",
" ans = True",
" for n in xrange(2, int(ceil(sqrt(num)))+1):\n if num % n =... |
#!/usr/bin/python
import time, sys
import itertools
"""
Find the greatest product of five consecutive digits in the 1000-digit number.
"""
def main():
start = time.time()
num = '73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545... | [
[
1,
0,
0.0811,
0.027,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.1081,
0.027,
0,
0.66,
0.25,
808,
0,
1,
0,
0,
808,
0,
0
],
[
8,
0,
0.2162,
0.1351,
0,
0.66... | [
"import time, sys",
"import itertools",
"\"\"\" \nFind the greatest product of five consecutive digits in the 1000-digit number.\n\n\n\"\"\"",
"def main():\n start = time.time()\n \n num = '731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789... |
#!/usr/bin/python
"""What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? """
import time
def main():
start = time.time()
seq = [x for x in range(1, 20)]
print seq
solved = False
i = 20
while solved == False:
for n in reversed... | [
[
8,
0,
0.0857,
0.0286,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1429,
0.0286,
0,
0.66,
0.3333,
654,
0,
1,
0,
0,
654,
0,
0
],
[
2,
0,
0.5286,
0.6857,
0,
0.66... | [
"\"\"\"What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? \"\"\"",
"import time",
"def main():\n start = time.time()\n \n seq = [x for x in range(1, 20)]\n print(seq)\n solved = False \n i = 20",
" start = time.time()",
" seq = [x... |
#!/usr/bin/python
# http://projecteuler.net/problem=14
#
import time
"""
Starting in the top left corner of a 2 x 2 grid, there are 6 routes (without backtracking) to the bottom right corner.
How many routes are there through a 20 x 20 grid?
"""
def main():
start = time.time()
start r
prin... | [
[
1,
0,
0.2,
0.04,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
8,
0,
0.42,
0.24,
0,
0.66,
0.3333,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.68,
0.2,
0,
0.66,
0.6667,
... | [
"import time",
"\"\"\" \nStarting in the top left corner of a 2 x 2 grid, there are 6 routes (without backtracking) to the bottom right corner.\n\n\nHow many routes are there through a 20 x 20 grid?\n\"\"\"",
"def main():\n start = time.time()\n \n \n print('{0:.2f} s'.format(time.time() - start))",... |
#!/usr/bin/python
def main():
""" sum the integers up to 1000 divisible by 3 or 5 """
nums = set()
for i in xrange(1000):
if i % 3 == 0:
nums.add(i)
if i % 5 == 0:
nums.add(i)
total = sum(nums)
print total
if __name__ == '__main__':
main()
| [
[
2,
0,
0.5,
0.5882,
0,
0.66,
0,
624,
0,
0,
0,
0,
0,
0,
6
],
[
8,
1,
0.2941,
0.0588,
1,
0.2,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.3529,
0.0588,
1,
0.2,
0.25,... | [
"def main():\n \"\"\" sum the integers up to 1000 divisible by 3 or 5 \"\"\"\n nums = set()\n for i in xrange(1000):\n if i % 3 == 0:\n nums.add(i)\n if i % 5 == 0:\n nums.add(i)",
" \"\"\" sum the integers up to 1000 divisible by 3 or 5 \"\"\"",
" nums = set()... |
#!/usr/bin/python
import time, sys
from math import sqrt, ceil, floor, log10
"""
the sum of 10! is 3628800
Find the sum of the digits in 100!
"""
def factorial(n):
if n == 1:
fact = 1
else:
fact = n * factorial(n-1)
return fact
def main():
start = time.time()
n = 1... | [
[
1,
0,
0.0698,
0.0233,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.093,
0.0233,
0,
0.66,
0.2,
526,
0,
4,
0,
0,
526,
0,
0
],
[
8,
0,
0.2093,
0.1628,
0,
0.66... | [
"import time, sys",
"from math import sqrt, ceil, floor, log10",
"\"\"\" \n\nthe sum of 10! is 3628800\n\nFind the sum of the digits in 100!\n \n\"\"\"",
"def factorial(n):\n if n == 1:\n fact = 1\n else:\n fact = n * factorial(n-1)\n return fact",
" if n == 1:\n fact = 1... |
#!/usr/bin/python
import time, sys
"""
Problem 17
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE: D... | [
[
1,
0,
0.0357,
0.0119,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
8,
0,
0.125,
0.119,
0,
0.66,
0.25,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.375,
0.3571,
0,
0.66,
... | [
"import time, sys",
"\"\"\" \nProblem 17\n\nIf the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.\n\nIf all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?\n\nNOTE: Do... |
#!/usr/bin/python
"""What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? """
import time
def main():
start = time.time()
seq = [x for x in range(1, 20)]
print seq
solved = False
i = 20
while solved == False:
for n in reversed... | [
[
8,
0,
0.0857,
0.0286,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1429,
0.0286,
0,
0.66,
0.3333,
654,
0,
1,
0,
0,
654,
0,
0
],
[
2,
0,
0.5286,
0.6857,
0,
0.66... | [
"\"\"\"What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? \"\"\"",
"import time",
"def main():\n start = time.time()\n \n seq = [x for x in range(1, 20)]\n print(seq)\n solved = False \n i = 20",
" start = time.time()",
" seq = [x... |
#!/usr/bin/python
import time, sys
from math import pow as power
"""
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 552 = 3025
Hence the difference between the sum of the squares of the first... | [
[
1,
0,
0.0714,
0.0238,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.0952,
0.0238,
0,
0.66,
0.1667,
526,
0,
1,
0,
0,
526,
0,
0
],
[
8,
0,
0.2619,
0.2619,
0,
... | [
"import time, sys",
"from math import pow as power",
"\"\"\" \nThe sum of the squares of the first ten natural numbers is,\n\n1^2 + 2^2 + ... + 10^2 = 385\nThe square of the sum of the first ten natural numbers is,\n\n(1 + 2 + ... + 10)^2 = 552 = 3025\nHence the difference between the sum of the squares of the ... |
#!/usr/bin/python
import time, sys
from math import ceil, sqrt, floor
"""
A Hamming number is a positive number which has no prime factor larger than 5.
So the first few Hamming numbers are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15.
There are 1105 Hamming numbers not exceeding 10^8.
We will call a positive number a gene... | [
[
1,
0,
0.0273,
0.0091,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.0364,
0.0091,
0,
0.66,
0.1667,
526,
0,
3,
0,
0,
526,
0,
0
],
[
8,
0,
0.1136,
0.1091,
0,
... | [
"import time, sys",
"from math import ceil, sqrt, floor",
"\"\"\" \n\nA Hamming number is a positive number which has no prime factor larger than 5.\nSo the first few Hamming numbers are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15.\nThere are 1105 Hamming numbers not exceeding 10^8.\n\nWe will call a positive number a g... |
#!/usr/bin/python
import time
from math import sqrt, ceil
def isprime(num):
ans = True
for n in xrange(2, int(ceil(sqrt(num)))+1):
if num % n == 0:
ans = False
break
return ans
def main():
""" What is the 10 001st prime number?"""
start = time.time()
prime = 1... | [
[
1,
0,
0.0882,
0.0294,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.1176,
0.0294,
0,
0.66,
0.25,
526,
0,
2,
0,
0,
526,
0,
0
],
[
2,
0,
0.2794,
0.2353,
0,
0.... | [
"import time",
"from math import sqrt, ceil",
"def isprime(num):\n ans = True\n for n in xrange(2, int(ceil(sqrt(num)))+1):\n if num % n == 0:\n ans = False\n break\n\n return ans",
" ans = True",
" for n in xrange(2, int(ceil(sqrt(num)))+1):\n if num % n =... |
#!/usr/bin/python
# http://projecteuler.net/problem=14
#
import time
"""
The following iterative sequence is defined for the set of positive integers:
n n/2 (n is even)
n 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 40 20 10 5 16 8 4 2 1
It can b... | [
[
1,
0,
0.0833,
0.0167,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
8,
0,
0.2583,
0.2667,
0,
0.66,
0.25,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.5,
0.1833,
0,
0.66,
... | [
"import time",
"\"\"\" \nThe following iterative sequence is defined for the set of positive integers:\n\nn n/2 (n is even)\nn 3n + 1 (n is odd)\n\nUsing the rule above and starting with 13, we generate the following sequence:",
"def collatz(n):\n i = 1\n \n while n > 1:\n if n%2 != 0:\n ... |
#!/usr/bin/python
import time, sys
import itertools
"""
Find the greatest product of five consecutive digits in the 1000-digit number.
"""
def main():
start = time.time()
num = '73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545... | [
[
1,
0,
0.0811,
0.027,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.1081,
0.027,
0,
0.66,
0.25,
808,
0,
1,
0,
0,
808,
0,
0
],
[
8,
0,
0.2162,
0.1351,
0,
0.66... | [
"import time, sys",
"import itertools",
"\"\"\" \nFind the greatest product of five consecutive digits in the 1000-digit number.\n\n\n\"\"\"",
"def main():\n start = time.time()\n \n num = '731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789... |
#!/usr/bin/python
def main():
""" sum the integers up to 1000 divisible by 3 or 5 """
nums = set()
for i in xrange(1000):
if i % 3 == 0:
nums.add(i)
if i % 5 == 0:
nums.add(i)
total = sum(nums)
print total
if __name__ == '__main__':
main()
| [
[
2,
0,
0.5,
0.5882,
0,
0.66,
0,
624,
0,
0,
0,
0,
0,
0,
6
],
[
8,
1,
0.2941,
0.0588,
1,
0.3,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.3529,
0.0588,
1,
0.3,
0.25,... | [
"def main():\n \"\"\" sum the integers up to 1000 divisible by 3 or 5 \"\"\"\n nums = set()\n for i in xrange(1000):\n if i % 3 == 0:\n nums.add(i)\n if i % 5 == 0:\n nums.add(i)",
" \"\"\" sum the integers up to 1000 divisible by 3 or 5 \"\"\"",
" nums = set()... |
#!/usr/bin/python
# version 2
import time, sys
import itertools
"""
In the 20 x 20 grid below, four numbers along a diagonal line have been marked in red.
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88... | [
[
1,
0,
0.0364,
0.0091,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.0455,
0.0091,
0,
0.66,
0.1111,
808,
0,
1,
0,
0,
808,
0,
0
],
[
8,
0,
0.1864,
0.2545,
0,
... | [
"import time, sys",
"import itertools",
"\"\"\" \nIn the 20 x 20 grid below, four numbers along a diagonal line have been marked in red.\n\n08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08\n49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00\n81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49... |
#!/usr/bin/python
import time, sys
from math import sqrt, ceil, floor
"""
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
Find the largest palindrome made from the product of two 3-digit numbers.
"""
def ispalindrome(x):
x = s... | [
[
1,
0,
0.0769,
0.0256,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.1026,
0.0256,
0,
0.66,
0.2,
526,
0,
3,
0,
0,
526,
0,
0
],
[
8,
0,
0.2051,
0.1282,
0,
0.6... | [
"import time, sys",
"from math import sqrt, ceil, floor",
"\"\"\" \nA palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.\n\nFind the largest palindrome made from the product of two 3-digit numbers.\n\"\"\"",
"def ispalindrome(x):\... |
#!/usr/bin/python
import time, sys
from math import sqrt, ceil, floor, log10
"""
The Fibonacci sequence is defined by the recurrence relation:
fn = fn1 + fn2, where F1 = 1 afnd F2 = 1.
Hence the first 12 terms will be:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F12 = 144
The 12th term, F12,... | [
[
1,
0,
0.0303,
0.0101,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.0404,
0.0101,
0,
0.66,
0.25,
526,
0,
4,
0,
0,
526,
0,
0
],
[
8,
0,
0.1667,
0.2222,
0,
0.... | [
"import time, sys",
"from math import sqrt, ceil, floor, log10",
"\"\"\" \nThe Fibonacci sequence is defined by the recurrence relation:\n\nfn = fn1 + fn2, where F1 = 1 afnd F2 = 1.\nHence the first 12 terms will be:\n\nF1 = 1\nF2 = 1",
"def main():\n start = time.time()\n \n a, b, fn = 0, 1, 1 \n ... |
#!/usr/bin/python
import time, sys
from math import sqrt, ceil, floor, log10
"""
the sum of 10! is 3628800
Find the sum of the digits in 100!
"""
def factorial(n):
if n == 1:
fact = 1
else:
fact = n * factorial(n-1)
return fact
def main():
start = time.time()
n = 1... | [
[
1,
0,
0.0698,
0.0233,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.093,
0.0233,
0,
0.66,
0.2,
526,
0,
4,
0,
0,
526,
0,
0
],
[
8,
0,
0.2093,
0.1628,
0,
0.66... | [
"import time, sys",
"from math import sqrt, ceil, floor, log10",
"\"\"\" \n\nthe sum of 10! is 3628800\n\nFind the sum of the digits in 100!\n \n\"\"\"",
"def factorial(n):\n if n == 1:\n fact = 1\n else:\n fact = n * factorial(n-1)\n return fact",
" if n == 1:\n fact = 1... |
#!/usr/bin/python
import time, sys
from math import sqrt, ceil, floor
"""
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million
"""
def isprime(num):
ans = True
if num <= 1:
return False
if num == 2:
return True
for n in xrange(2,... | [
[
1,
0,
0.0638,
0.0213,
0,
0.66,
0,
654,
0,
2,
0,
0,
654,
0,
0
],
[
1,
0,
0.0851,
0.0213,
0,
0.66,
0.2,
526,
0,
3,
0,
0,
526,
0,
0
],
[
8,
0,
0.1702,
0.1064,
0,
0.6... | [
"import time, sys",
"from math import sqrt, ceil, floor",
"\"\"\" \nThe sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.\n\nFind the sum of all the primes below two million \n\"\"\"",
"def isprime(num):\n ans = True\n if num <= 1:\n return False\n if num == 2:\n return True\n for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.