code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0508, 0.0065, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0573, 0.0032, 0, 0.66, 0.0435, 638, 0, 7, 0, 0, 638, 0, 0 ], [ 1, 0, 0.0613, 0.0048, 0, 0.66...
[ "'''\nRewriters modify the graph of matchers before it is used to generate a \nparser.\n'''", "from lepl.support.graph import Visitor, preorder, loops, order, NONTREE, \\\n dfs_edges, LEAF", "from lepl.matchers.combine import DepthFirst, DepthNoTrampoline, \\\n BreadthFirst, BreadthNoTrampoline, And, AndN...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0827, 0.008, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0987, 0.0027, 0, 0.66, 0.1429, 40, 0, 3, 0, 0, 40, 0, 0 ], [ 1, 0, 0.1013, 0.0027, 0, 0.66, ...
[ "'''\nTools for logging and tracing.\n'''", "from lepl.core.monitor import ActiveMonitor, ValueMonitor, StackMonitor", "from lepl.support.lib import CircularFifo, LogMixin, sample, format, str", "def TraceResults(enabled=False):\n '''\n A basic logger (implemented as a monitor - `MonitorInterface`)\n ...
from lepl.support.lib import identity # The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the Li...
[ [ 1, 0, 0.0032, 0.0032, 0, 0.66, 0, 898, 0, 1, 0, 0, 898, 0, 0 ], [ 8, 0, 0.1036, 0.0097, 0, 0.66, 0.0667, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1165, 0.0032, 0, 0.66...
[ "from lepl.support.lib import identity", "'''\nTests for the lepl.core.rewriters module.\n'''", "from re import sub", "from unittest import TestCase", "from lepl import Any, Or, Delayed, Optional, Node, Drop, And, Join, Digit", "from lepl.support.graph import preorder", "from lepl.matchers.matcher impor...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.5962, 0.0577, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.6538, 0.0192, 0, 0.66, 0.3333, 240, 0, 1, 0, 0, 240, 0, 0 ], [ 1, 0, 0.6923, 0.0192, 0, 0.66...
[ "'''\nTests for bug reprted on the mailing list.\n'''", "from lepl._test.base import BaseTest", "from lepl import *", "class RepeatTest(BaseTest):\n \n def test_no_regexp(self):\n xy = ('x' & Drop('y'))[1]\n xy.config.no_compile_to_regexp()\n assert xy.parse('xy') == ['x']\n ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.4844, 0.0469, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.5312, 0.0156, 0, 0.66, 0.3333, 240, 0, 1, 0, 0, 240, 0, 0 ], [ 1, 0, 0.5625, 0.0156, 0, 0.66...
[ "'''\nTests for bug reprted on the mailing list.\n'''", "from lepl._test.base import BaseTest", "from lepl import *", "class LiteralTest(BaseTest):\n \n def test_as_given(self):\n \n c = Delayed()\n \n a = Literal(\"a\") + c\n b = Literal(\"b\")", " def test_as_gi...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2403, 0.0233, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2713, 0.0078, 0, 0.66, 0.1667, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.2791, 0.0078, 0, 0.66...
[ "'''\nTests for the lepl.core.config module.\n'''", "from sys import version", "from unittest import TestCase", "from lepl import *", "from lepl._test.base import assert_str", "class ParseTest(TestCase):\n \n def run_test(self, name, text, parse, match2, match3, error, \n config=lamb...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.7111, 0.0667, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.8889, 0.0222, 0, 0.66, 0.1667, 9, 0, 1, 0, 0, 9, 0, 0 ], [ 1, 0, 0.9111, 0.0222, 0, 0.66, ...
[ "'''\nTests for the lepl.core package.\n'''", "import lepl.core._test.config", "import lepl.core._test.manager", "import lepl.core._test.parser", "import lepl.core._test.rewriters", "import lepl.core._test.rewrite_delayed_bug", "import lepl.core._test.rewrite_repeat_bug" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.3647, 0.0353, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.4118, 0.0118, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4353, 0.0118, 0, 0.66, ...
[ "'''\nTests for the lepl.core.manager module.\n'''", "from unittest import TestCase", "from lepl.matchers.derived import Eos", "from lepl.matchers.core import Literal", "from lepl.support.lib import LogMixin", "class LimitedDepthTest(LogMixin, TestCase):\n '''\n The test here takes '****' and divide...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2818, 0.0273, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3091, 0.0091, 0, 0.66, 0.125, 423, 0, 1, 0, 0, 423, 0, 0 ], [ 1, 0, 0.3182, 0.0091, 0, 0.66,...
[ "'''\nTests for the lepl.core.parser module.\n'''", "from traceback import format_exc", "from types import MethodType", "from unittest import TestCase", "from lepl import Literal, Any, function_matcher", "class InstanceMethodTest(TestCase):\n \n class Foo(object):\n class_attribute = 1\n ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1132, 0.0209, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.2422, 0.223, 0, 0.66, 0.1667, 769, 0, 10, 0, 0, 186, 0, 0 ], [ 8, 1, 0.1394, 0.0105, 1, 0.45...
[ "'''\nSupport for classes that monitor the execution process (for example, managing \nresources and tracing program flow).\n\nSee `trampoline()`.\n'''", "class ValueMonitor(object):\n '''\n An interface expected by `trampoline()`, called to track data flow.\n '''\n \n def next_iteration(self, epoch...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0306, 0.003, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0335, 0.001, 0, 0.66, 0.1667, 353, 0, 3, 0, 0, 353, 0, 0 ], [ 1, 0, 0.0345, 0.001, 0, 0.66, ...
[ "'''\nThe main configuration object and various standard configurations.\n'''", "from lepl.core.parser import make_raw_parser, make_single, make_multiple", "from lepl.stream.stream import DEFAULT_STREAM_FACTORY", "class ConfigurationError(Exception):\n pass", "class Configuration(object):\n '''\n E...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.9688, 0.0938, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ] ]
[ "'''\nCore classes, related to parsing, config etc.\n'''" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1579, 0.1088, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2175, 0.0035, 0, 0.66, 0.1429, 251, 0, 3, 0, 0, 251, 0, 0 ], [ 1, 0, 0.2211, 0.0035, 0, 0.66...
[ "'''\nManage resources.\n\nWe can attempt to control resource consumption by closing generators - the\nproblem is which generators to close?\n\nAt first it seems that the answer is going to be connected to tree traversal,\nbut after some thought it's not so clear exactly what tree is being traversed,", "from heap...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1319, 0.0315, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1575, 0.0039, 0, 0.66, 0.0833, 193, 0, 1, 0, 0, 193, 0, 0 ], [ 1, 0, 0.1614, 0.0039, 0, 0.66...
[ "'''\nCreate and evaluate parsers.\n\nOnce a consistent set of matchers is constructed (that describes a grammar)\nthey must be evaluated against some input. The code here supports that \nevaluation (via `trampoline()`) and allows the graph of matchers to be \nrewritten beforehand.\n'''", "from collections impor...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.8857, 0.0857, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.9714, 0.0286, 0, 0.66, 1, 921, 0, 1, 0, 0, 921, 0, 0 ] ]
[ "'''\nPunt to the contrib package (this is just to keep copyright clear).\n'''", "from lepl.contrib.json import Simple" ]
from lepl.apps.json import Simple from lepl._test.base import BaseTest class JsonTest(BaseTest): def test_dict(self): self.assert_direct('{"a": 123, "b": "somewhere"}', Simple(), [[{'a': 123.0, 'b': 'somewhere'}]]) def test_escape(self): self.assert_di...
[ [ 1, 0, 0.0667, 0.0333, 0, 0.66, 0, 110, 0, 1, 0, 0, 110, 0, 0 ], [ 1, 0, 0.1, 0.0333, 0, 0.66, 0.5, 240, 0, 1, 0, 0, 240, 0, 0 ], [ 3, 0, 0.6, 0.8333, 0, 0.66, ...
[ "from lepl.apps.json import Simple", "from lepl._test.base import BaseTest", "class JsonTest(BaseTest):\n \n def test_dict(self):\n self.assert_direct('{\"a\": 123, \"b\": \"somewhere\"}', Simple(),\n [[{'a': 123.0, 'b': 'somewhere'}]])\n \n def test_escape(self)...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1136, 0.011, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1245, 0.0037, 0, 0.66, 0.0909, 715, 0, 2, 0, 0, 715, 0, 0 ], [ 1, 0, 0.1319, 0.0037, 0, 0.66,...
[ "'''\nTests for the lepl.apps.rfc3696 module.\n'''", "from logging import basicConfig, DEBUG", "from lepl import *", "from lepl._test.base import BaseTest", "from lepl.apps.rfc3696 import _PreferredFullyQualifiedDnsName, _EmailLocalPart,\\\n _Email, _HttpUrl, MailToUrl, HttpUrl, Email, _IpV4Address, _Ipv...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.775, 0.075, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.975, 0.025, 0, 0.66, 0.5, 811, 0, 1, 0, 0, 811, 0, 0 ], [ 1, 0, 1, 0.025, 0, 0.66, 1, ...
[ "'''\nTests for the lepl.apps package.\n'''", "import lepl.apps._test.rfc3696", "import lepl.apps._test.json" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0699, 0.0167, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0814, 0.0021, 0, 0.66, 0.0526, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0835, 0.0021, 0, 0.66...
[ "'''\nMatchers for validating URIs and related objects, taken from RFC3696.\n\nIMPORTANT - the emphasis here is on validation of user input.\nThese matchers are not exact matches for the underlying specs - they are\njust useful practical approximations. Read RFC3696 to see what I mean\n(or the quotes from that doc...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2581, 0.0403, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2903, 0.0081, 0, 0.66, 0.0714, 844, 0, 1, 0, 0, 844, 0, 0 ], [ 1, 0, 0.2984, 0.0081, 0, 0.66...
[ "'''\nError handling (generating an error while parsing).\n\nThis is not that complete or well thought through; it needs to be revised.\n'''", "from lepl.support.node import Node", "from lepl.support.lib import format", "def make_error(msg):\n '''\n Create an error node using a format string.\n \n ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0978, 0.0095, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1293, 0.0032, 0, 0.66, 0.0667, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.1356, 0.0032, 0, 0.66...
[ "'''\nMatchers that embody fundamental, common actions.\n'''", "from re import compile as compile_", "from lepl.core.parser import tagged", "from lepl.regexp.matchers import DfaRegexp", "from lepl.matchers.support import OperatorMatcher, coerce_, \\\n function_matcher, function_matcher_factory, trampolin...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1659, 0.0742, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2445, 0.0044, 0, 0.66, 0.0667, 38, 0, 1, 0, 0, 38, 0, 0 ], [ 1, 0, 0.2533, 0.0044, 0, 0.66, ...
[ "'''\nA transformation is a function that modifies the result of calling a matcher\nonce.\n\nFrom the point of view of a transformation, a matcher is a function that \ntakes no arguments and either returns (results, stream_out) or raises a \nStopIteration (note - this is an interface - the way you typically define ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0443, 0.0043, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0486, 0.0014, 0, 0.66, 0.0217, 687, 0, 1, 0, 0, 687, 0, 0 ], [ 1, 0, 0.0501, 0.0014, 0, 0.66...
[ "'''\nSupport for operator syntactic sugar (and operator redefinition).\n'''", "from lepl.matchers.matcher import Matcher", "from lepl.support.context import Namespace, NamespaceMixin, Scope", "from lepl.support.lib import open_stop, format, basestring", "class OperatorNamespace(Namespace):\n '''\n De...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.31, 0.03, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.35, 0.01, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.37, 0.01, 0, 0.66, 0.4, 70...
[ "'''\nTests for the lepl.matchers.error module.\n'''", "from unittest import TestCase", "from lepl import Literal, Error", "from lepl.matchers.error import make_error", "from lepl.matchers.variables import TraceVariables", "class MessageTest(TestCase):\n '''\n Check generation of Error nodes.\n '...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0323, 0.0031, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0365, 0.001, 0, 0.66, 0.0455, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0385, 0.001, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.core module.\n'''", "from unittest import TestCase", "from lepl._test.base import BaseTest, assert_str", "from lepl.matchers.combine import And, Or", "from lepl.matchers.core import Any, Literal, Eof, Regexp, Delayed, Lookahead, \\\n Consumer, PostMatch", "from lepl.ma...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.6739, 0.0652, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.7609, 0.0217, 0, 0.66, 0.25, 240, 0, 1, 0, 0, 240, 0, 0 ], [ 1, 0, 0.7826, 0.0217, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.transform module\n'''", "from lepl._test.base import BaseTest", "from lepl.matchers.core import Any", "from lepl.matchers.transform import PostCondition", "class PostConditionTest(BaseTest):\n \n def test_post_condition(self):\n self.assert_fail('abc', PostCond...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2583, 0.025, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2833, 0.0083, 0, 0.66, 0.1429, 83, 0, 1, 0, 0, 83, 0, 0 ], [ 1, 0, 0.2917, 0.0083, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.operators module.\n'''", "from threading import Thread", "from unittest import TestCase", "from lepl import Delayed, Any, Eos, Drop, Separator, Literal, Space, \\\n SmartSeparator1, Optional", "class ThreadTest(TestCase):\n '''\n Test for thread safety.\n '''\n ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.164, 0.0159, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1852, 0.0053, 0, 0.66, 0.1, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.1958, 0.0053, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.derived module.\n'''", "from unittest import TestCase", "from lepl import *", "from lepl._test.base import BaseTest", "from lepl.matchers.support import OperatorMatcher", "from lepl.core.parser import tagged", "class RepeatTest(TestCase):\n\n def test_simple(self):\n...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0812, 0.0079, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0916, 0.0026, 0, 0.66, 0.2, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0942, 0.0026, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.memo module.\n'''", "from time import time", "from unittest import TestCase", "from lepl import Delayed, Any, Optional, Node, Literals, Eos, Token, Or", "class MemoTest(TestCase):\n \n def test_right(self):\n \n #basicConfig(level=DEBUG)\n \n ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0972, 0.0094, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1097, 0.0031, 0, 0.66, 0.1111, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.1176, 0.0063, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.separators module.\n'''", "from unittest import TestCase", "from lepl import And, Optional, Space, Separator, SmartSeparator1, \\\n SmartSeparator2, Eos", "PRINT = False", "STREAMS_3 = ['a b c ',\n 'a b c',\n ' b c',\n 'b c',\n 'ab...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.3974, 0.0385, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.4359, 0.0128, 0, 0.66, 0.1667, 518, 0, 1, 0, 0, 518, 0, 0 ], [ 1, 0, 0.4615, 0.0128, 0, 0.66...
[ "'''\nTests for the lepl.matchers.variables module.\n'''", "from io import StringIO", "from unittest import TestCase", "from lepl._test.base import assert_str", "from lepl.matchers.core import Any", "from lepl.matchers.variables import NamedResult, TraceVariables", "class ExplicitTest(TestCase):\n \n...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # ba...
[ [ 8, 0, 0.3896, 0.039, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.4416, 0.013, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4675, 0.013, 0, 0.66, 0....
[ "'''\nTests for the combining matchers.\n'''", "from unittest import TestCase", "from lepl.matchers.combine import DepthFirst, BreadthFirst", "from lepl.matchers.core import Any", "class DirectionTest1(TestCase):\n \n def matcher(self):\n return Any()\n \n def test_depth(self):\n #...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1867, 0.0181, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2108, 0.006, 0, 0.66, 0.125, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.2259, 0.012, 0, 0.66, ...
[ "'''\nTests for the lepl.matchers.support module\n'''", "from unittest import TestCase", "from lepl.matchers.support import function_matcher_factory, function_matcher, \\\n sequence_matcher_factory, sequence_matcher", "def char(support, stream):\n if stream:\n return ([stream[0]], stream[1:])", ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.64, 0.06, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.7, 0.02, 0, 0.66, 0.0909, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.82, 0.02, 0, 0.66, 0.1818,...
[ "'''\nTests for the lepl.matchers package.\n'''", "from sys import version", "import lepl.matchers._test.combine", "import lepl.matchers._test.core", "import lepl.matchers._test.derived", "import lepl.matchers._test.error", "import lepl.matchers._test.memo", "import lepl.matchers._test.operators", "...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0453, 0.0044, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0504, 0.0029, 0, 0.66, 0.0167, 890, 0, 7, 0, 0, 890, 0, 0 ], [ 1, 0, 0.054, 0.0015, 0, 0.66,...
[ "'''\nMatchers that are defined in terms of other matchers (ie the majority).\n'''", "from string import whitespace, digits, ascii_letters, \\\n ascii_uppercase, ascii_lowercase, printable, punctuation", "from lepl.core.parser import tagged", "from lepl.matchers.combine import And, DepthFirst, BreadthFirst...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0944, 0.0225, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1183, 0.0028, 0, 0.66, 0.0556, 38, 0, 1, 0, 0, 38, 0, 0 ], [ 1, 0, 0.1211, 0.0028, 0, 0.66, ...
[ "'''\nMemoisation (both as described by Norvig 1991, giving Packrat \nparsers for non-left recursive grammars, and the equivalent described by\nFrost and Hafiz 2006 which allows left-recursive grammars to be used).\n \nNote that neither paper describes the extension to backtracking with\ngenerators implemented here...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2818, 0.0273, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3091, 0.0091, 0, 0.66, 0.1667, 547, 0, 1, 0, 0, 547, 0, 0 ], [ 1, 0, 0.3182, 0.0091, 0, 0.66...
[ "'''\nMatchers that interact with monitors.\n'''", "from lepl.matchers.core import OperatorMatcher", "from lepl.core.manager import _GeneratorManager", "from lepl.core.trace import _TraceResults", "from lepl.core.parser import tagged", "class Commit(OperatorMatcher):\n '''\n Commit to the current st...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2207, 0.0345, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2483, 0.0069, 0, 0.66, 0.1111, 777, 0, 2, 0, 0, 777, 0, 0 ], [ 1, 0, 0.2552, 0.0069, 0, 0.66...
[ "'''\nDisplay information when matchers that are bound to variables are called.\n\nThis is possible thanks to a neat trick suggested by Carl Banks on c.l.p \n'''", "from __future__ import generators, print_function", "from contextlib import contextmanager", "from sys import stderr, _getframe", "from lepl.ma...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0779, 0.0075, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.103, 0.0025, 0, 0.66, 0.0417, 38, 0, 1, 0, 0, 38, 0, 0 ], [ 1, 0, 0.1055, 0.0025, 0, 0.66, ...
[ "'''\nMatchers that combine sub-matchers (And, Or etc).\n'''", "from abc import ABCMeta", "from collections import deque", "from lepl.matchers.core import Literal", "from lepl.matchers.matcher import add_children", "from lepl.matchers.support import coerce_, sequence_matcher_factory, \\\n trampoline_ma...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1442, 0.014, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1628, 0.0047, 0, 0.66, 0.0455, 38, 0, 2, 0, 0, 38, 0, 0 ], [ 1, 0, 0.1674, 0.0047, 0, 0.66, ...
[ "'''\nBase class for matchers.\n'''", "from abc import ABCMeta, abstractmethod", "from types import FunctionType", "from lepl.support.lib import format, singleton, identity", "_Matcher = ABCMeta('_Matcher', (object, ), {})", "'''\nABC used to identify matchers. \n\nNote that graph traversal assumes subcl...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0457, 0.0044, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0501, 0.0015, 0, 0.66, 0.0303, 878, 0, 1, 0, 0, 878, 0, 0 ], [ 1, 0, 0.0531, 0.0015, 0, 0.66...
[ "'''\nSupport classes for matchers.\n'''", "from inspect import getargspec", "from lepl.core.config import ParserMixin", "from lepl.core.parser import GeneratorWrapper, tagged", "from lepl.support.graph import ArgAsAttributeMixin, PostorderWalkerMixin, \\\n GraphStr", "from lepl.matchers.matcher import...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.8488, 0.3256, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ] ]
[ "'''\nMatchers form the basis of the library; they are used to define the grammar\nand do the work of parsing the input.\n\nA matcher is like a parser combinator - it takes a stream, matches content in\nthe stream, and returns a list of tokens and a new stream. However, matchers\nare also coroutines that can be \"...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2474, 0.2662, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3857, 0.0034, 0, 0.66, 0.037, 523, 0, 1, 0, 0, 523, 0, 0 ], [ 1, 0, 0.3891, 0.0034, 0, 0.66,...
[ "'''\nLepl is a parser library written in Python.\n \nThis is the API documentation; the module index is at the bottom of this page. \nThere is also a `manual <../index.html>`_ which gives a higher level\noverview. \n\nThe home page for this package is the", "from lepl.contrib.matchers import SmartSeparator2", ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2403, 0.0233, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2636, 0.0078, 0, 0.66, 0.1111, 193, 0, 1, 0, 0, 193, 0, 0 ], [ 1, 0, 0.2791, 0.0078, 0, 0.66...
[ "'''\nRewrite a matcher graph to include lexing.\n'''", "from collections import deque", "from lepl.core.rewriters import Rewriter", "from lepl.lexer.matchers import BaseToken, Lexer, LexerError, NonToken", "from lepl.matchers.matcher import Matcher, is_child", "from lepl.regexp.unicode import UnicodeAlph...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.4638, 0.0435, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.5362, 0.0145, 0, 0.66, 0.3333, 708, 0, 4, 0, 0, 708, 0, 0 ], [ 1, 0, 0.5507, 0.0145, 0, 0.66...
[ "'''\nIllustrate some of the finer points of lexing.\n'''", "from lepl import Token, Integer, Eos, Literal", "from lepl._example.support import Example", "class Limitations(Example):\n '''\n These are used in the lexer part of the manual.\n '''\n\n def test_ambiguity(self):\n '''\n A...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.2812, 0.0357, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3125, 0.0089, 0, 0.66, 0.2, 526, 0, 2, 0, 0, 526, 0, 0 ], [ 1, 0, 0.3214, 0.0089, 0, 0.66, ...
[ "'''\nAn example from the manual based on a test in this package (currently not used\nin docs because something similar is developed in the tutorial).\n'''", "from math import sin, cos", "from operator import add, sub, truediv, mul", "from lepl import Node, Token, UnsignedFloat, Delayed, Or, Eos", "from lep...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.775, 0.075, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.975, 0.025, 0, 0.66, 0.5, 701, 0, 1, 0, 0, 701, 0, 0 ], [ 1, 0, 1, 0.025, 0, 0.66, 1, ...
[ "'''\nExamples for the lepl.lexer package.\n'''", "import lepl.lexer._example.calculator", "import lepl.lexer._example.limitations" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.775, 0.075, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.975, 0.025, 0, 0.66, 0.5, 465, 0, 1, 0, 0, 465, 0, 0 ], [ 1, 0, 1, 0.025, 0, 0.66, 1, ...
[ "'''\nTests for the lepl.lexer package.\n'''", "import lepl.lexer._test.matchers", "import lepl.lexer._test.stream" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0871, 0.0084, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1067, 0.0028, 0, 0.66, 0.1111, 526, 0, 2, 0, 0, 526, 0, 0 ], [ 1, 0, 0.1096, 0.0028, 0, 0.66...
[ "'''\nWide range of tests for lexer.\n'''", "from math import sin, cos", "from operator import add, sub, truediv, mul", "from unittest import TestCase", "from lepl import Token, Literal, Float, LexerError, Node, Delayed, Any, Eos, \\\n UnsignedFloat, Or, RuntimeLexerError, Word", "from lepl.support.lib...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.3605, 0.0349, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.4535, 0.0116, 0, 0.66, 0.3333, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4767, 0.0116, 0, 0.66, ...
[ "'''\nCheck location data within tokens.\n'''", "from unittest import TestCase", "from lepl import *", "class LocationTest(TestCase):\n \n def test_location_token(self):\n '''\n Check that location is correct for a token.\n '''\n #basicConfig(level=DEBUG)\n text = '\\n...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.6739, 0.0652, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.7935, 0.087, 0, 0.66, 0.5, 417, 0, 0, 0, 0, 645, 0, 0 ], [ 8, 1, 0.8043, 0.0652, 1, 0.2, ...
[ "'''\nSupport classes for the lexer.\n'''", "class LexerError(Exception):\n '''\n Errors associated with the lexer\n '''", " '''\n Errors associated with the lexer\n '''", "class RuntimeLexerError(LexerError):\n '''\n Error raised for problems with lexing.\n '''", " '''\n Er...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.9688, 0.0938, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ] ]
[ "'''\nA lexer (tokenizer) for Lepl.\n'''" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0831, 0.0106, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0976, 0.0026, 0, 0.66, 0.0357, 38, 0, 1, 0, 0, 38, 0, 0 ], [ 1, 0, 0.1029, 0.0026, 0, 0.66, ...
[ "'''\nGenerate and match a stream of tokens that are identified by regular \nexpressions.\n'''", "from abc import ABCMeta", "from lepl.support.context import Namespace, NamespaceMixin", "from lepl.matchers.derived import Add, Apply, Drop, KApply, Repeat, Map", "from lepl.lexer.stream import lexed_simple_str...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1435, 0.0139, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1574, 0.0046, 0, 0.66, 0.1111, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.1667, 0.0046, 0, 0.66...
[ "'''\nThe token streams.\n'''", "from logging import getLogger", "from lepl.stream.filters import BaseDelegateSource", "from lepl.lexer.support import RuntimeLexerError", "from lepl.stream.stream import LocationStream, DEFAULT_STREAM_FACTORY", "from lepl.support.lib import format, str", "def lexed_simpl...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.7619, 0.0714, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.9524, 0.0238, 0, 0.66, 0.3333, 370, 0, 1, 0, 0, 370, 0, 0 ], [ 1, 0, 0.9762, 0.0238, 0, 0.66...
[ "'''\nTests for the lepl.stream package.\n'''", "import lepl.stream._test.filters", "import lepl.stream._test.maxdepth", "import lepl.stream._test.stream" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.252, 0.0244, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2846, 0.0081, 0, 0.66, 0.1111, 616, 0, 1, 0, 0, 616, 0, 0 ], [ 1, 0, 0.2927, 0.0081, 0, 0.66,...
[ "'''\nTests for the lepl.stream.filters module.\n'''", "from operator import eq", "from unittest import TestCase", "from lepl.stream.filters import Filter, FilteredSource, Exclude, \\\n ExcludeSequence, FilterException", "from lepl.matchers.core import Any, Literal", "from lepl.stream.stream import DE...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.1235, 0.012, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1355, 0.004, 0, 0.66, 0.0909, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.1394, 0.004, 0, 0.66, ...
[ "'''\nTests for the lepl.stream.stream module.\n'''", "from random import choice", "from unittest import TestCase", "from lepl.stream.stream import SimpleStream, DEFAULT_STREAM_FACTORY", "def repr26(value):\n '''\n Convert to string with crude hack for 2.6 Unicode\n '''\n string = repr(value)\n ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.223, 0.0216, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2518, 0.0072, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.259, 0.0072, 0, 0.66, 0...
[ "'''\nTests for the lepl.stream.maxdepth module.\n'''", "from unittest import TestCase", "from lepl import Any, Eos, Optional", "from lepl.stream.maxdepth import FullFirstMatch, FullFirstMatchException, facade_factory", "class FullFirstMatchTest(TestCase):\n \n def test_stream(self):\n matcher ...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.9688, 0.0938, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ] ]
[ "'''\nStreams are used to bind location data to text during parsing.\n'''" ]
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # b...
[ [ 8, 0, 0.0735, 0.0071, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0829, 0.0024, 0, 0.66, 0.0588, 547, 0, 1, 0, 0, 547, 0, 0 ], [ 1, 0, 0.0853, 0.0024, 0, 0.66...
[ "'''\nFilter and transform streams.\n'''", "from lepl.matchers.core import OperatorMatcher", "from lepl.core.parser import tagged", "from lepl.stream.stream import Source, LocationStream, DEFAULT_STREAM_FACTORY", "from lepl.support.lib import str", "class FilterException(Exception):\n '''\n Raised w...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # ba...
[ [ 8, 0, 0.0868, 0.1072, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1422, 0.0012, 0, 0.66, 0.04, 38, 0, 3, 0, 0, 38, 0, 0 ], [ 1, 0, 0.1434, 0.0012, 0, 0.66, ...
[ "'''\nStream interfaces for the input, with an implementation using singly linked\nlists.\n\nThis package defines both interfaces (via ABCs) and implementations.\n\n\nInterfaces", "from abc import ABCMeta, abstractmethod, abstractproperty", "from io import StringIO, IOBase", "from lepl.support.lib import open...
# The contents of this file are subject to the Mozilla Public License # (MPL) Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # ba...
[ [ 8, 0, 0.1622, 0.0162, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1784, 0.0054, 0, 0.66, 0.1429, 473, 0, 2, 0, 0, 473, 0, 0 ], [ 1, 0, 0.1838, 0.0054, 0, 0.66...
[ "'''\nTrack the maximum depth of a stream.\n'''", "from lepl.stream.stream import LocationStream, SimpleStream", "from lepl.matchers.support import trampoline_matcher_factory", "from lepl.support.lib import open_stop, format", "class Memory(object):\n \n def __init__(self, deepest):\n self.deep...
#!/usr/bin/env python # -*- Mode: Python; indent-tabs-mode: nil -*- # vi: set ts=4 sw=4 expandtab: # # The MIT License # # Copyright (c) 2011 Alexander Macdonald # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
[ [ 1, 0, 0.0172, 0.0172, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0345, 0.0172, 0, 0.66, 0.1, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0517, 0.0172, 0, 0.6...
[ "import os", "import shutil", "import tempfile", "import re", "import sys", "import optparse", "from ifdef.parser import *", "def computestats(x, sizemap):\n if isinstance(x, Ifdef):\n for c in x.children:\n computestats(c, sizemap)\n elif isinstance(x, Branch):\n if x.c...
#!/usr/bin/env python # -*- Mode: Python; indent-tabs-mode: nil -*- # vi: set ts=4 sw=4 expandtab: # # The MIT License # # Copyright (c) 2011 Alexander Macdonald # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
[ [ 1, 0, 0.157, 0.0058, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1628, 0.0058, 0, 0.66, 0.1111, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.1686, 0.0058, 0, 0...
[ "import os", "import shutil", "import tempfile", "import re", "import sys", "import optparse", "from ifdef.parser import *", "def serializeifdefs(xs, dst, opts):\n # we only tag the else/endif with the conditional if it\n # is further than 'threshold' lines away from the\n # if/ifdef/ifndef/e...
#!/usr/bin/env python # -*- Mode: Python; indent-tabs-mode: nil -*- # vi: set ts=4 sw=4 expandtab: # # The MIT License # # Copyright (c) 2011 Alexander Macdonald # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
[]
[]
#!/usr/bin/env python # -*- Mode: Python; indent-tabs-mode: nil -*- # vi: set ts=4 sw=4 expandtab: # # The MIT License # # Copyright (c) 2011 Alexander Macdonald # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
[ [ 1, 0, 0.0682, 0.0025, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0707, 0.0025, 0, 0.66, 0.0175, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0732, 0.0025, 0, ...
[ "import os", "import shutil", "import tempfile", "import re", "import optparse", "from lepl import *", "class ASTNode(object):\n def __init__(self, pr):\n self.args = pr", " def __init__(self, pr):\n self.args = pr", " self.args = pr", "class ExprNode(ASTNode): pass", ...
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
[ [ 8, 0, 0.1486, 0.0064, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1565, 0.0032, 0, 0.66, 0.0714, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.1629, 0.0032, 0, 0.66,...
[ "\"\"\"Google Code file uploader script.\n\"\"\"", "__author__ = 'danderson@google.com (David Anderson)'", "import httplib", "import os.path", "import optparse", "import getpass", "import base64", "import sys", "def get_svn_config_dir():\n \"\"\"Return user's Subversion configuration directory.\"\"...
#!/usr/bin/python2.6 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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...
[ [ 8, 0, 0.0645, 0.0036, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0717, 0.0036, 0, 0.66, 0.0385, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0789, 0.0036, 0, 0.66,...
[ "\"\"\"Build the BITE Extension.\"\"\"", "__author__ = 'ralphj@google.com (Julie Ralph)'", "import logging", "import optparse", "import os", "import shutil", "import subprocess", "import urllib", "import zipfile", "CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')", "CHECKOUT...
# Run from the commandline: # # python server.py # POST audio to http://localhost:9000 # GET audio from http://localhost:9000 # # A simple server to collect audio using python. To be more secure, # you might want to check the file names and place size restrictions # on the incoming data. import cgi from BaseHTTPSe...
[ [ 1, 0, 0.2075, 0.0189, 0, 0.66, 0, 934, 0, 1, 0, 0, 934, 0, 0 ], [ 1, 0, 0.2264, 0.0189, 0, 0.66, 0.25, 801, 0, 2, 0, 0, 801, 0, 0 ], [ 3, 0, 0.5189, 0.5283, 0, 0....
[ "import cgi", "from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer", "class WamiHandler(BaseHTTPRequestHandler):\n dirname = \"/tmp/\"\n \n def do_GET(self):\n f = open(self.get_name())\n self.send_response(200)\n self.send_header('content-type','audio/x-wav')\n se...
#!/usr/bin/python import xml.parsers.expat; import sys; import re; parser=xml.parsers.expat.ParserCreate('UTF-8'); values_en = {} values_lang = {} values_hash = {} name='' def parse(lang, values): def start_element(n, attrs): global name; if n != u'string': return name=attrs[u'name'] def end_element(...
[ [ 1, 0, 0.0448, 0.0149, 0, 0.66, 0, 573, 0, 1, 0, 0, 573, 0, 0 ], [ 1, 0, 0.0597, 0.0149, 0, 0.66, 0.0588, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0746, 0.0149, 0, ...
[ "import xml.parsers.expat;", "import sys;", "import re;", "parser=xml.parsers.expat.ParserCreate('UTF-8');", "values_en = {}", "values_lang = {}", "values_hash = {}", "name=''", "def parse(lang, values):\n def start_element(n, attrs):\n global name;\n if n != u'string': return\n name=attrs...
__author__ = 'jcorbett' import unittest import types import time import random from rest import RestApi, get_default_release, get_default_build, AttributeDict random.seed() class TestrunGroupTests(unittest.TestCase): """ Tests for adding, deleting, updating specifically projects. """ def setUp(self):...
[ [ 14, 0, 0.008, 0.008, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.024, 0.008, 0, 0.66, 0.1429, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.032, 0.008, 0, 0.66, ...
[ "__author__ = 'jcorbett'", "import unittest", "import types", "import time", "import random", "from rest import RestApi, get_default_release, get_default_build, AttributeDict", "random.seed()", "class TestrunGroupTests(unittest.TestCase):\n \"\"\"\n Tests for adding, deleting, updating specifica...
import json import urllib import urlparse import httplib2 json_content = {'Content-Type': 'application/json'} STREAM_CONTENT = {'Content-Type': 'application/octet-stream'} GET = 'GET' POST = 'POST' PUT = 'PUT' DELETE = 'DELETE' class AttributeDict(dict): __getattr__ = dict.__getitem__ __setattr__ = dict.__set...
[ [ 1, 0, 0.0085, 0.0085, 0, 0.66, 0, 463, 0, 1, 0, 0, 463, 0, 0 ], [ 1, 0, 0.0171, 0.0085, 0, 0.66, 0.0667, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0256, 0.0085, 0, ...
[ "import json", "import urllib", "import urlparse", "import httplib2", "json_content = {'Content-Type': 'application/json'}", "STREAM_CONTENT = {'Content-Type': 'application/octet-stream'}", "GET = 'GET'", "POST = 'POST'", "PUT = 'PUT'", "DELETE = 'DELETE'", "class AttributeDict(dict):\n __get...
__author__ = 'jcorbett' import unittest from rest import RestApi class ProjectTest(unittest.TestCase): """ Tests for adding, deleting, updating specifically projects. """ def setUp(self): self.api = RestApi("http://localhost:9090/api") def create_project(self, **kwargs): if "nam...
[ [ 14, 0, 0.011, 0.011, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.033, 0.011, 0, 0.66, 0.3333, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.044, 0.011, 0, 0.66, ...
[ "__author__ = 'jcorbett'", "import unittest", "from rest import RestApi", "class ProjectTest(unittest.TestCase):\n \"\"\"\n Tests for adding, deleting, updating specifically projects.\n \"\"\"\n\n def setUp(self):\n self.api = RestApi(\"http://localhost:9090/api\")", " \"\"\"\n Test...
#!/usr/bin/env python __author__ = 'jcorbett' import argparse import pymongo import sys from gridfs import GridFS def main(arguments): parser = argparse.ArgumentParser(description='Remove files from a set of results.') parser.add_argument("-p", "--project", dest="project", required=True, help="The project to...
[ [ 14, 0, 0.0392, 0.0196, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0784, 0.0196, 0, 0.66, 0.1667, 325, 0, 1, 0, 0, 325, 0, 0 ], [ 1, 0, 0.098, 0.0196, 0, 0....
[ "__author__ = 'jcorbett'", "import argparse", "import pymongo", "import sys", "from gridfs import GridFS", "def main(arguments):\n parser = argparse.ArgumentParser(description='Remove files from a set of results.')\n parser.add_argument(\"-p\", \"--project\", dest=\"project\", required=True, help=\"...
#!/usr/bin/env python import os from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() #TODO: support pip and dependencies setup( name = "slickqa", version = "0.1.407", author = "Chris Saxey", author_email = "jared.jorgensen@quest.com",...
[ [ 1, 0, 0.08, 0.04, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.12, 0.04, 0, 0.66, 0.3333, 152, 0, 1, 0, 0, 152, 0, 0 ], [ 2, 0, 0.22, 0.08, 0, 0.66, 0....
[ "import os", "from distutils.core import setup", "def read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()", " return open(os.path.join(os.path.dirname(__file__), fname)).read()", "setup(\n name = \"slickqa\",\n version = \"0.1.407\",\n author = \"Chris Saxey\",\n...
import os import sys import thread import threading import datetime import traceback from logging import * from slickApi import SlickAsPy from dateutil.tz import * ERROR = 40 WARN = 30 INFO = 20 DEBUG = 10 TRACE = 5 log_levels = { ERROR : 'ERROR', WARN : 'WARN', INFO : 'INFO', DEBUG : 'DEBUG', TRA...
[ [ 1, 0, 0.0057, 0.0057, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0115, 0.0057, 0, 0.66, 0.0435, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0172, 0.0057, 0, ...
[ "import os", "import sys", "import thread", "import threading", "import datetime", "import traceback", "from logging import *", "from slickApi import SlickAsPy", "from dateutil.tz import *", "ERROR = 40", "WARN = 30", "INFO = 20", "DEBUG = 10", "TRACE = 5", "log_levels = {\n ERROR : '...
import json import zlib import urllib import urlparse import httplib2 import traceback from dateutil.tz import * from datetime import datetime import slick_utilities json_content = {'Content-Type': 'application/json'} STREAM_CONTENT = {'Content-Type': 'application/octet-stream'} GET = 'GET' POST = 'POST' PUT = 'PUT' D...
[ [ 1, 0, 0.0018, 0.0018, 0, 0.66, 0, 463, 0, 1, 0, 0, 463, 0, 0 ], [ 1, 0, 0.0037, 0.0018, 0, 0.66, 0.05, 373, 0, 1, 0, 0, 373, 0, 0 ], [ 1, 0, 0.0055, 0.0018, 0, 0....
[ "import json", "import zlib", "import urllib", "import urlparse", "import httplib2", "import traceback", "from dateutil.tz import *", "from datetime import datetime", "import slick_utilities", "json_content = {'Content-Type': 'application/json'}", "STREAM_CONTENT = {'Content-Type': 'application/...
import sys import logging from unittest import TestSuite, util, case from unittest.suite import _isnotsuite,_DebugResult,_ErrorHolder from SlickTestResult import SlickTestResult class SlickTestSuite(TestSuite): def __init__(self, tests=(), loggerName='root'): super(SlickTestSuite, self).__init__(tests) ...
[ [ 1, 0, 0.0074, 0.0074, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0147, 0.0074, 0, 0.66, 0.2, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0221, 0.0074, 0, 0.6...
[ "import sys", "import logging", "from unittest import TestSuite, util, case", "from unittest.suite import _isnotsuite,_DebugResult,_ErrorHolder", "from SlickTestResult import SlickTestResult", "class SlickTestSuite(TestSuite):\n def __init__(self, tests=(), loggerName='root'):\n super(SlickTestS...
from datetime import datetime, timedelta from dateutil.tz import * #---------------------------------------------------------------------- def get_date(): """ A date object formatted for slick with the local time zone """ return datetime.now(tzlocal()).strftime('%a, %m %b %Y %H:%M:%S %Z')
[ [ 1, 0, 0.1111, 0.1111, 0, 0.66, 0, 426, 0, 2, 0, 0, 426, 0, 0 ], [ 1, 0, 0.2222, 0.1111, 0, 0.66, 0.5, 872, 0, 1, 0, 0, 872, 0, 0 ], [ 2, 0, 0.7778, 0.5556, 0, 0.6...
[ "from datetime import datetime, timedelta", "from dateutil.tz import *", "def get_date():\n \"\"\"\n A date object formatted for slick with the local time zone\n \"\"\"\n return datetime.now(tzlocal()).strftime('%a, %m %b %Y %H:%M:%S %Z')", " \"\"\"\n A date object formatted for slick with t...
import logging from slickApi import * from unittest import TestResult from datetime import datetime, timedelta from dateutil.tz import * import slick_utilities FIN = "FINISHED" class SlickTestResult(TestResult): """Adds reporting through slick""" def __init__(self, project, testRunRef, slick, loggername='roo...
[ [ 1, 0, 0.0052, 0.0052, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0104, 0.0052, 0, 0.66, 0.1429, 747, 0, 1, 0, 0, 747, 0, 0 ], [ 1, 0, 0.0155, 0.0052, 0, ...
[ "import logging", "from slickApi import *", "from unittest import TestResult", "from datetime import datetime, timedelta", "from dateutil.tz import *", "import slick_utilities", "FIN = \"FINISHED\"", "class SlickTestResult(TestResult):\n \"\"\"Adds reporting through slick\"\"\"\n\n def __init__(...
import logging import sys from unittest import TestCase, SkipTest from unittest.case import _ExpectedFailure, _UnexpectedSuccess from slickApi import SlickAsPy from slickLogging import Slicklogger class SlickTestCase(TestCase): """""" logger = None queued_files = [] # for wing ide source assistance and...
[ [ 1, 0, 0.0102, 0.0102, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0204, 0.0102, 0, 0.66, 0.1667, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0306, 0.0102, 0, ...
[ "import logging", "import sys", "from unittest import TestCase, SkipTest", "from unittest.case import _ExpectedFailure, _UnexpectedSuccess", "from slickApi import SlickAsPy", "from slickLogging import Slicklogger", "class SlickTestCase(TestCase):\n \"\"\"\"\"\"\n logger = None\n queued_files = ...
from slickApi import SlickAsPy, SlickError from SlickTestResult import SlickTestResult from SlickTestRunner import SlickTestRunner from slickLogging import SlickFormatter, SlickHandler, Slicklogger from SlickTestCase import SlickTestCase from SlickTestSuite import SlickTestSuite __all__ = ["SlickAsPy", "SlickError", "...
[ [ 1, 0, 0.0909, 0.0909, 0, 0.66, 0, 747, 0, 2, 0, 0, 747, 0, 0 ], [ 1, 0, 0.1818, 0.0909, 0, 0.66, 0.1667, 802, 0, 1, 0, 0, 802, 0, 0 ], [ 1, 0, 0.2727, 0.0909, 0, ...
[ "from slickApi import SlickAsPy, SlickError", "from SlickTestResult import SlickTestResult", "from SlickTestRunner import SlickTestRunner", "from slickLogging import SlickFormatter, SlickHandler, Slicklogger", "from SlickTestCase import SlickTestCase", "from SlickTestSuite import SlickTestSuite", "__all...
import logging import traceback import re import slickLogging from slickApi import SlickAsPy, SlickError from SlickTestResult import SlickTestResult from unittest import TextTestRunner from unittest.signals import registerResult from slick_utilities import get_date class SlickTestRunner(TextTestRunner): """ A ...
[ [ 1, 0, 0.003, 0.003, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0061, 0.003, 0, 0.66, 0.1111, 423, 0, 1, 0, 0, 423, 0, 0 ], [ 1, 0, 0.0091, 0.003, 0, 0.66...
[ "import logging", "import traceback", "import re", "import slickLogging", "from slickApi import SlickAsPy, SlickError", "from SlickTestResult import SlickTestResult", "from unittest import TextTestRunner", "from unittest.signals import registerResult", "from slick_utilities import get_date", "clas...
#!/usr/bin/python2.6 # # Simple http server to emulate api.playfoursquare.com import logging import shutil import sys import urlparse import SimpleHTTPServer import BaseHTTPServer class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Handle playfoursquare.com requests, for testing.""" def do_GET(self...
[ [ 1, 0, 0.0588, 0.0118, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0706, 0.0118, 0, 0.66, 0.125, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0824, 0.0118, 0, 0...
[ "import logging", "import shutil", "import sys", "import urlparse", "import SimpleHTTPServer", "import BaseHTTPServer", "class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',...
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
[ [ 1, 0, 0.0201, 0.0067, 0, 0.66, 0, 426, 0, 1, 0, 0, 426, 0, 0 ], [ 1, 0, 0.0268, 0.0067, 0, 0.66, 0.0769, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0336, 0.0067, 0, ...
[ "import datetime", "import sys", "import textwrap", "import common", "from xml.dom import pulldom", "PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;", "BOOLEAN_STANZA = \"\"\"\\\n } else i...
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
[ [ 8, 0, 0.0631, 0.0991, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1261, 0.009, 0, 0.66, 0.05, 2, 0, 1, 0, 0, 2, 0, 0 ], [ 1, 0, 0.1351, 0.009, 0, 0.66, 0....
[ "\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD", "import httplib", "import os", "import re", "import sys", "import urllib", "import urllib2", "import urlparse", "import user", "from xml....
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basena...
[ [ 1, 0, 0.1111, 0.037, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1481, 0.037, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.6...
[ "import os", "import subprocess", "import sys", "BASEDIR = '../main/src/com/joelapenna/foursquare'", "TYPESDIR = '../captures/types/v1'", "captures = sys.argv[1:]", "if not captures:\n captures = os.listdir(TYPESDIR)", " captures = os.listdir(TYPESDIR)", "for f in captures:\n basename = f.split('...
#!/usr/bin/python import logging from xml.dom import minidom from xml.dom import pulldom BOOLEAN = "boolean" STRING = "String" GROUP = "Group" # Interfaces that all FoursquareTypes implement. DEFAULT_INTERFACES = ['FoursquareType'] # Interfaces that specific FoursqureTypes implement. INTERFACES = { } DEFAULT_CLA...
[ [ 1, 0, 0.0263, 0.0088, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0439, 0.0088, 0, 0.66, 0.0833, 290, 0, 1, 0, 0, 290, 0, 0 ], [ 1, 0, 0.0526, 0.0088, 0, ...
[ "import logging", "from xml.dom import minidom", "from xml.dom import pulldom", "BOOLEAN = \"boolean\"", "STRING = \"String\"", "GROUP = \"Group\"", "DEFAULT_INTERFACES = ['FoursquareType']", "INTERFACES = {\n}", "DEFAULT_CLASS_IMPORTS = [\n]", "CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP...
# module pyparsing.py # # Copyright (c) 2003-2010 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to u...
[ [ 14, 0, 0.0112, 0.009, 0, 0.66, 0, 155, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0161, 0.0003, 0, 0.66, 0.0068, 162, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0164, 0.0003, 0, 0....
[ "__doc__ = \\\n\"\"\"\npyparsing module - Classes and methods to define and execute parsing grammars\n\nThe pyparsing module is an alternative approach to creating and executing simple grammars,\nvs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you\ndon't need to learn a ne...
# module pyparsing.py # # Copyright (c) 2003-2010 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to u...
[ [ 14, 0, 0.0112, 0.009, 0, 0.66, 0, 155, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0161, 0.0003, 0, 0.66, 0.0068, 162, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0164, 0.0003, 0, 0....
[ "__doc__ = \\\n\"\"\"\npyparsing module - Classes and methods to define and execute parsing grammars\n\nThe pyparsing module is an alternative approach to creating and executing simple grammars,\nvs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you\ndon't need to learn a ne...
#!/usr/bin/python import sys import os import string import subprocess import time """ Usage: rpcexec -n n_to_start -f [hostsfile] [program] [options] To start local only: rpcexec [program] [options] """ def escape(s): s = string.replace(s, '"', '\\"') s = string.replace(s, "'", "\\'") return s #enddef # gui: ...
[ [ 1, 0, 0.0087, 0.0044, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0131, 0.0044, 0, 0.66, 0.0294, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0175, 0.0044, 0, ...
[ "import sys", "import os", "import string", "import subprocess", "import time", "\"\"\"\nUsage: rpcexec -n n_to_start -f [hostsfile] [program] [options]\nTo start local only: rpcexec [program] [options]\n\"\"\"", "def escape(s):\n s = string.replace(s, '\"', '\\\\\"')\n s = string.replace(s, \"'\", \"...
import math # Python implementation of pagerank def update(scope, scheduler): vertex = scope.getVertex() oldval = vertex.value newval = vertex.value * vertex.selfEdgeWeight newval = newval + sum([e.weight*e.value for e in scope.getInboundEdges()]) vertex.setValue(newval) if (abs(newval-oldval)...
[ [ 1, 0, 0.0556, 0.0556, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 2, 0, 0.4722, 0.4444, 0, 0.66, 0.5, 637, 0, 2, 0, 0, 0, 0, 6 ], [ 14, 1, 0.3333, 0.0556, 1, 0, ...
[ "import math", "def update(scope, scheduler):\n vertex = scope.getVertex()\n oldval = vertex.value\n newval = vertex.value * vertex.selfEdgeWeight\n newval = newval + sum([e.weight*e.value for e in scope.getInboundEdges()])\n vertex.setValue(newval)\n if (abs(newval-oldval)>0.00001):\n sc...
class pagerank_vertex: def __init__(self, value, selfedge): self.rank = value self.selfedge = selfedge f = open(filename, "r") lines = f.readlines() # First line is header header = lines[0] lines = lines[1:] nvertices = int(header.split(",")[1]) for i in range(0,nvertices): # format: first v...
[ [ 3, 0, 0.1552, 0.1379, 0, 0.66, 0, 613, 0, 1, 0, 0, 0, 0, 0 ], [ 2, 1, 0.1724, 0.1034, 1, 0.77, 0, 555, 0, 3, 0, 0, 0, 0, 0 ], [ 14, 2, 0.1724, 0.0345, 2, 0.47, ...
[ "class pagerank_vertex:\n def __init__(self, value, selfedge):\n self.rank = value\n self.selfedge = selfedge", " def __init__(self, value, selfedge):\n self.rank = value\n self.selfedge = selfedge", " self.rank = value", " self.selfedge = selfedge", "f = open...
import math # Python implementation of pagerank damping = 0.85 def update(scope, scheduler): pvertex = scope.getVertex().value sumval = pvertex.rank * pvertex.selfedge + sum([e.value * scope.getNeighbor(e.from).value.rank for e in scope.getInboundEdges()]) newval = (1-damping)/scope.getNumOfVertices() + ...
[ [ 1, 0, 0.0556, 0.0556, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.2778, 0.0556, 0, 0.66, 0.3333, 196, 1, 0, 0, 0, 0, 2, 0 ], [ 2, 0, 0.5278, 0.3333, 0, 0...
[ "import math", "damping = 0.85", "def update(scope, scheduler):\n pvertex = scope.getVertex().value\n newval = (1-damping)/scope.getNumOfVertices() + damping*sumval\n if (abs(newval-pvertex.rank)>0.00001):\n scheduler.addTaskToOutbound(scope)\n pvertex.rank = newval", " pvertex = scope.g...
import math lamb = 0.5 # Python implementation of Lasso Shooting algorithm. # min ||Ax-y||_2^2 + lambda ||x||_1 def update(scope, scheduler): # Of class lasso_variable_vertex or lasso_estimate_vertex lassov = scope.getVertex().value if (lassov.vtype == 0): if lassov.initialized == False: ...
[ [ 1, 0, 0.0227, 0.0227, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.0682, 0.0227, 0, 0.66, 0.25, 511, 1, 0, 0, 0, 0, 2, 0 ], [ 2, 0, 0.4886, 0.5909, 0, 0.6...
[ "import math", "lamb = 0.5", "def update(scope, scheduler):\n # Of class lasso_variable_vertex or lasso_estimate_vertex\n lassov = scope.getVertex().value\n \n if (lassov.vtype == 0):\n if lassov.initialized == False:\n # Initialize covariance\n lassov.covar = 2.0*sum([e...
leastsqr_err = 0.0 penalty = 0.0 lamb = 0.5 for v in graph.getVertices(): lassov = v.value if lassov.vtype == 0: penalty += lamb * abs(lassov.value) else: leastsqr_err += pow(lassov.observed - lassov.curval,2) print("Objective:", penalty + leastsqr_err)
[ [ 14, 0, 0.1333, 0.0667, 0, 0.66, 0, 22, 1, 0, 0, 0, 0, 2, 0 ], [ 14, 0, 0.2, 0.0667, 0, 0.66, 0.25, 255, 1, 0, 0, 0, 0, 2, 0 ], [ 14, 0, 0.3333, 0.0667, 0, 0.66, ...
[ "leastsqr_err = 0.0", "penalty = 0.0", "lamb = 0.5", "for v in graph.getVertices():\n lassov = v.value\n if lassov.vtype == 0:\n penalty += lamb * abs(lassov.value)\n else:\n leastsqr_err += pow(lassov.observed - lassov.curval,2)", " lassov = v.value", " if lassov.vtype == 0:\...
graphlab.setScheduler("round_robin") graphlab.setIterations(100) graphlab.setScopeType("vertex")
[ [ 8, 0, 0.6, 0.2, 0, 0.66, 0, 471, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.8, 0.2, 0, 0.66, 0.5, 770, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 1, 0.2, 0, 0.66, 1, 979, 3...
[ "graphlab.setScheduler(\"round_robin\")", "graphlab.setIterations(100)", "graphlab.setScopeType(\"vertex\")" ]
for v in graph.getVertices(): print(v.value.rank)
[ [ 6, 0, 0.9, 0.4, 0, 0.66, 0, 553, 3, 0, 0, 0, 0, 0, 2 ], [ 8, 1, 1, 0.2, 1, 0, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "for v in graph.getVertices():\n print(v.value.rank)", " print(v.value.rank)" ]
# # Solve Lasso: min ||Ax-y||_2^2 + \lambda ||x||_1 # # We present Lasso as a bipartite graph. On the left side, we have # variables x_i (predictors) and on the right side the current estimates # for y_i = (Ax)_i. Sides are connected by edges weighted by A_ij # # # Rights side of the graph. Estimate for y_i. We st...
[ [ 3, 0, 0.2465, 0.0845, 0, 0.66, 0, 19, 0, 1, 0, 0, 0, 0, 0 ], [ 2, 1, 0.2535, 0.0704, 1, 0.7, 0, 555, 0, 3, 0, 0, 0, 0, 0 ], [ 14, 2, 0.2394, 0.0141, 2, 0.05, ...
[ "class lasso_estimate_vertex:\n def __init__(self, value, observed):\n self.curval = value\n self.lastval = value\n self.observed = observed\n self.vtype = 1", " def __init__(self, value, observed):\n self.curval = value\n self.lastval = value\n self.observed...
#! /usr/bin/env python # encoding: utf-8 # waf 1.6.2 VERSION='0.3.3' import sys APPNAME='p2t' top = '.' out = 'build' CPP_SOURCES = ['poly2tri/common/shapes.cc', 'poly2tri/sweep/cdt.cc', 'poly2tri/sweep/advancing_front.cc', 'poly2tri/sweep/sweep_context.cc', ...
[ [ 14, 0, 0.1111, 0.0222, 0, 0.66, 0, 557, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.1333, 0.0222, 0, 0.66, 0.0909, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.1556, 0.0222, 0, ...
[ "VERSION='0.3.3'", "import sys", "APPNAME='p2t'", "top = '.'", "out = 'build'", "CPP_SOURCES = ['poly2tri/common/shapes.cc',\n 'poly2tri/sweep/cdt.cc',\n 'poly2tri/sweep/advancing_front.cc',\n 'poly2tri/sweep/sweep_context.cc',\n 'poly2tri/sweep/swee...