id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,400 | time_format.py | CouchPotato_CouchPotatoServer/libs/pyutil/time_format.py | # ISO-8601:
# http://www.cl.cam.ac.uk/~mgk25/iso-time.html
import calendar, datetime, re, time
def iso_utc_date(now=None, t=time.time):
if now is None:
now = t()
return datetime.datetime.utcfromtimestamp(now).isoformat()[:10]
def iso_utc(now=None, sep=' ', t=time.time, suffix='Z'):
if now is None... | 2,299 | Python | .py | 61 | 32.04918 | 195 | 0.605299 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,401 | weakutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/weakutil.py | # Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import warnings
# from the Python Standard Library
from weakref import ref
# from the pyutil library
from assertutil import precondition
# Thanks to Thomas Wouters, JP Calderone and the authors from th... | 1,368 | Python | .py | 32 | 36.9375 | 84 | 0.671192 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,402 | testutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/testutil.py | import os, signal, time
from twisted.internet import defer, reactor
from twisted.trial import unittest
import repeatable_random
repeatable_random # http://divmod.org/trac/ticket/1499
class SignalMixin:
# This class is necessary for any code which wants to use Processes
# outside the usual reactor.run() envir... | 4,955 | Python | .py | 103 | 39.398058 | 87 | 0.672528 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,403 | zlibutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/zlibutil.py | # Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
Making your zlib experience that much nicer!
Most importantly, this offers protection from "zlib bomb" attacks, where the
original data was maximally compressable, and a naive use of zlib would
cons... | 15,919 | Python | .py | 228 | 62.802632 | 420 | 0.704241 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,404 | benchutil.py~ | CouchPotato_CouchPotatoServer/libs/pyutil/benchutil.py~ | # Copyright (c) 2002-2013 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
Benchmark a function for its behavior with respect to N.
How to use this module:
1. Define a function which runs the code that you want to benchmark. The
function takes a single argument which is t... | 9,210 | Python | .py | 209 | 39.449761 | 255 | 0.65328 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,405 | mathutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/mathutil.py | # Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
A few commonly needed functions.
"""
import math
def div_ceil(n, d):
"""
The smallest integer k such that k*d >= n.
"""
return int((n//d) + (n%d != 0))
def next_multiple(n, k):
... | 2,257 | Python | .py | 87 | 20.712644 | 78 | 0.559275 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,406 | test_dictutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/deprecated/test_dictutil.py | #!/usr/bin/env python
# Copyright (c) 2002-2009 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import random, sys, traceback, unittest
from pyutil.assertutil import _assert
from pyutil import dictutil
class EqButNotIs:
def __init__(self, x):
self.x = x... | 3,612 | Python | .py | 97 | 28.587629 | 117 | 0.529311 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,407 | test_xor.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/deprecated/test_xor.py | #!/usr/bin/env python
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# portions Copyright (c) 2001 Autonomous Zone Industries
# This file is part of pyutil; see README.rst for licensing terms.
#
import unittest
from pyutil.xor import xor
# unit tests
def _help_test(xf):
assert xf('\000', '\000') == '\000'
... | 745 | Python | .py | 20 | 32.25 | 67 | 0.617198 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,408 | test_picklesaver.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/deprecated/test_picklesaver.py | #!/usr/bin/env python
# Copyright (c) 2002 Luke 'Artimage' Nelson
# Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import os
try:
from twisted.trial import unittest
except ImportError, le:
print "Skipping %s since it requires Twisted and Twist... | 1,340 | Python | .py | 28 | 39.857143 | 107 | 0.653374 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,409 | test_assertutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_assertutil.py | #!/usr/bin/env python
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# portions Copyright (c) 2001 Autonomous Zone Industries
# This file is part of pyutil; see README.rst for licensing terms.
# Python Standard Library modules
import unittest
from pyutil import assertutil
class Testy(unittest.TestCase):
def ... | 710 | Python | .py | 14 | 45.714286 | 177 | 0.699422 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,410 | test_mathutil.py~ | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_mathutil.py~ | #!/usr/bin/env python
import unittest
from pyutil import mathutil
from pyutil.assertutil import _assert
class MathUtilTestCase(unittest.TestCase):
def _help_test_is_power_of_k(self, k):
for i in range(2, 40):
_assert(mathutil.is_power_of_k(k**i, k), k, i)
def test_is_power_of_k(self):
... | 5,253 | Python | .py | 120 | 34.175 | 76 | 0.560571 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,411 | test_fileutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_fileutil.py | import unittest
import os
from pyutil import fileutil
class FileUtil(unittest.TestCase):
def mkdir(self, basedir, path, mode=0777):
fn = os.path.join(basedir, path)
fileutil.make_dirs(fn, mode)
def touch(self, basedir, path, mode=None, data="touch\n"):
fn = os.path.join(basedir, path... | 939 | Python | .py | 26 | 28.384615 | 62 | 0.582781 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,412 | test_verlib.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_verlib.py | # -*- coding: utf-8 -*-
"""Tests for distutils.version."""
import unittest
import doctest
from pyutil.verlib import NormalizedVersion as V
from pyutil.verlib import IrrationalVersionError
from pyutil.verlib import suggest_normalized_version as suggest
class VersionTestCase(unittest.TestCase):
versions = ((V('1.0... | 4,315 | Python | .py | 102 | 32.362745 | 83 | 0.501194 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,413 | test_time_format.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_time_format.py | #!/usr/bin/env python
"""\
Test time_format.py
"""
import os, time, unittest
from pyutil import time_format, increasing_timer
class TimeUtilTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_iso8601_utc_time(self, timer=increasing_timer.timer):
... | 3,967 | Python | .py | 84 | 37.380952 | 94 | 0.610853 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,414 | test_jsonutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_jsonutil.py | #!/usr/bin/env python
import unittest
from decimal import Decimal
from pyutil import jsonutil
zero_point_one = Decimal("0.1")
class TestDecimal(unittest.TestCase):
def test_encode(self):
self.failUnlessEqual(jsonutil.dumps(zero_point_one), "0.1")
def test_decode(self):
self.failUnlessEqual(... | 508 | Python | .py | 12 | 37.833333 | 88 | 0.740816 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,415 | test_mathutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_mathutil.py | #!/usr/bin/env python
import unittest
from pyutil import mathutil
from pyutil.assertutil import _assert
class MathUtilTestCase(unittest.TestCase):
def _help_test_is_power_of_k(self, k):
for i in range(2, 40):
_assert(mathutil.is_power_of_k(k**i, k), k, i)
def test_is_power_of_k(self):
... | 5,567 | Python | .py | 127 | 34.267717 | 76 | 0.561475 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,416 | test_iputil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_iputil.py | #!/usr/bin/env python
try:
from twisted.trial import unittest
unittest # http://divmod.org/trac/ticket/1499
except ImportError, le:
print "Skipping test_iputil since it requires Twisted and Twisted could not be imported: %s" % (le,)
else:
from pyutil import iputil, testutil
import re
DOTTED_QU... | 1,287 | Python | .py | 28 | 36.071429 | 145 | 0.620415 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,417 | test_version_class.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/test_version_class.py | import unittest
from pyutil import version_class
V = version_class.Version
class T(unittest.TestCase):
def test_rc_regex_rejects_rc_suffix(self):
self.failUnlessRaises(ValueError, V, '9.9.9rc9')
def test_rc_regex_rejects_trailing_garbage(self):
self.failUnlessRaises(ValueError, V, '9.9.9c9HE... | 870 | Python | .py | 18 | 41.5 | 71 | 0.634002 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,418 | test_separators.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_separators.py | import textwrap
from unittest import TestCase
from pyutil import jsonutil as json
class TestSeparators(TestCase):
def test_separators(self):
h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',
{'nifty': 87}, {'field': 'yes', 'morefield': False} ]
expect = text... | 952 | Python | .py | 34 | 18.382353 | 82 | 0.457143 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,419 | test_fail.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_fail.py | from unittest import TestCase
from pyutil import jsonutil as json
# Fri Dec 30 18:57:26 2005
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json... | 2,908 | Python | .py | 72 | 34.333333 | 78 | 0.62041 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,420 | test_speedups.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_speedups.py | from twisted.trial.unittest import SkipTest, TestCase
from pyutil.jsonutil import decoder
from pyutil.jsonutil import encoder
class TestSpeedups(TestCase):
def test_scanstring(self):
if not encoder.c_encode_basestring_ascii:
raise SkipTest("no C extension speedups available to test")
s... | 835 | Python | .py | 15 | 47.4 | 93 | 0.723378 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,421 | test_indent.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_indent.py | from unittest import TestCase
from pyutil import jsonutil as json
import textwrap
class TestIndent(TestCase):
def test_indent(self):
h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',
{'nifty': 87}, {'field': 'yes', 'morefield': False} ]
expect = textwrap.dede... | 930 | Python | .py | 34 | 17.764706 | 82 | 0.458943 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,422 | test_dump.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_dump.py | from unittest import TestCase
from cStringIO import StringIO
from pyutil import jsonutil as json
class TestDump(TestCase):
def test_dump(self):
sio = StringIO()
json.dump({}, sio)
self.assertEquals(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEquals(json.dumps({}), '... | 325 | Python | .py | 10 | 27.2 | 47 | 0.669872 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,423 | test_unicode.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_unicode.py | from unittest import TestCase
from pyutil import jsonutil as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
... | 1,973 | Python | .py | 45 | 35.688889 | 77 | 0.600626 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,424 | test_recursion.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_recursion.py | from unittest import TestCase
from pyutil import jsonutil as json
class JSONTestObject:
pass
class RecursiveJSONEncoder(json.JSONEncoder):
recurse = False
def default(self, o):
if o is JSONTestObject:
if self.recurse:
return [JSONTestObject]
else:
... | 1,686 | Python | .py | 59 | 19.305085 | 78 | 0.556516 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,425 | test_pass2.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_pass2.py | from unittest import TestCase
from pyutil import jsonutil as json
# from http://json.org/JSON_checker/test/pass2.json
JSON = r'''
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
'''
class TestPass2(TestCase):
def test_parse(self):
# test in/out equivalence and parsing
res = json.loads(JSON)
... | 397 | Python | .py | 12 | 28.916667 | 52 | 0.626632 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,426 | test_pass1.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_pass1.py | from unittest import TestCase
from pyutil import jsonutil as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
... | 1,814 | Python | .py | 63 | 22.333333 | 93 | 0.483075 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,427 | test_encode_basestring_ascii.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_encode_basestring_ascii.py | from twisted.trial.unittest import SkipTest, TestCase
from pyutil.jsonutil import encoder
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u456... | 1,806 | Python | .py | 31 | 52.451613 | 199 | 0.571186 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,428 | test_decode.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_decode.py | import decimal
from unittest import TestCase
from pyutil import jsonutil as json
class TestDecode(TestCase):
def test_decimal(self):
rval = json.loads('1.1', parse_float=decimal.Decimal)
self.assert_(isinstance(rval, decimal.Decimal))
self.assertEquals(rval, decimal.Decimal('1.1'))
de... | 471 | Python | .py | 12 | 33.333333 | 61 | 0.695175 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,429 | test_default.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_default.py | from unittest import TestCase
from pyutil import jsonutil as json
class TestDefault(TestCase):
def test_default(self):
self.assertEquals(
json.dumps(type, default=repr),
json.dumps(repr(type)))
| 232 | Python | .py | 7 | 26.714286 | 43 | 0.695067 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,430 | test_float.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_float.py | import math
from unittest import TestCase
from pyutil import jsonutil as json
class TestFloat(TestCase):
def test_floats(self):
for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]:
self.assertEquals(float(json.dumps(num)), num)
| 272 | Python | .py | 7 | 34.142857 | 78 | 0.722433 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,431 | test_pass3.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/current/json_tests/test_pass3.py | from unittest import TestCase
from pyutil import jsonutil as json
# from http://json.org/JSON_checker/test/pass3.json
JSON = r'''
{
"JSON Test Pattern pass3": {
"The outermost value": "must be an object or array.",
"In this test": "It is an object."
}
}
'''
class TestPass3(TestCase):
def ... | 493 | Python | .py | 17 | 24.294118 | 61 | 0.655391 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,432 | test_strutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/out_of_shape/test_strutil.py | #!/usr/bin/env python
# Copyright (c) 2004-2009 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import unittest
from pyutil.assertutil import _assert
from pyutil import strutil
class Teststrutil(unittest.TestCase):
def test_short_input(self):
self.failUnl... | 1,713 | Python | .py | 23 | 68.304348 | 150 | 0.649436 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,433 | test_cache.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/out_of_shape/test_cache.py | #!/usr/bin/env python
# Copyright (c) 2002-2010 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import random, unittest
from pyutil.assertutil import _assert
from pyutil.humanreadable import hr
from pyutil import memutil
from pyutil import cache
class Bencher:
... | 16,980 | Python | .py | 390 | 34.702564 | 244 | 0.592823 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,434 | test_odict.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/out_of_shape/test_odict.py | #!/usr/bin/env python
# Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import random, unittest
from pyutil.humanreadable import hr
from pyutil import memutil
from pyutil import odict
class Bencher:
def __init__(self, klass, MAXREPS=2**8, MAXTIME... | 16,600 | Python | .py | 378 | 35.119048 | 294 | 0.582586 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,435 | test_zlibutil.py | CouchPotato_CouchPotatoServer/libs/pyutil/test/out_of_shape/test_zlibutil.py | #!/usr/bin/env python
import unittest
from pyutil import randutil
from pyutil import zlibutil
class Accumulator:
def __init__(self):
self.buf = ''
def write(self, str):
self.buf += str
def make_decomp(realdecomp):
def decomp(str, maxlen, maxmem):
d = Accumulator()
reald... | 3,283 | Python | .py | 63 | 43.142857 | 166 | 0.642233 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,436 | bench_json.py | CouchPotato_CouchPotatoServer/libs/pyutil/benchmarks/bench_json.py | from pyutil import randutil
import random
from decimal import Decimal
l = []
s = None
def data_strings(N):
assert isinstance(N, int), (N, type(N))
del l[:]
for i in range(N):
l.append(repr(randutil.insecurerandstr(4)))
global s
s = json.dumps(l)
def data_Decimals(N):
del l[:]
for ... | 1,210 | Python | .py | 44 | 22.886364 | 95 | 0.644156 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,437 | bench_xor.py | CouchPotato_CouchPotatoServer/libs/pyutil/benchmarks/bench_xor.py | #!/usr/bin/env python
# Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import hmac, sys, random
from pyutil.assertutil import _assert
from pyutil.xor import xor
from pyutil import benchfunc
from pyutil import randutil
SFUNCS = [hmac._strxor, xor.py_... | 1,658 | Python | .py | 43 | 32.302326 | 122 | 0.613084 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,438 | xor.py | CouchPotato_CouchPotatoServer/libs/pyutil/xor/xor.py | # Copyright © 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
What word has three letters and a 'x' in it?
Not that one silly.
"""
import warnings
import array, operator
from pyutil.assertutil import precondition
def py_xor(str1, str2):
warnings.warn("dep... | 1,604 | Python | .py | 39 | 35.641026 | 118 | 0.636774 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,439 | randcookie.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/randcookie.py | #!/usr/bin/env python
import os, sys
import zbase32
def main():
if len(sys.argv) > 1:
l = int(sys.argv[1])
else:
l = 64
bl = (l + 7) / 8
s = zbase32.b2a_l(os.urandom(bl), l)
# insert some hyphens for easier memorization
chs = 3 + (len(s)%8==0)
i = chs
while i < len(... | 463 | Python | .py | 21 | 16.428571 | 49 | 0.48037 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,440 | try_decoding.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/try_decoding.py | #!/usr/bin/env python
import binascii, codecs, encodings, locale, os, sys, zlib
import argparse
def listcodecs(dir):
names = []
for filename in os.listdir(dir):
if filename[-3:] != '.py':
continue
name = filename[:-3]
# Check whether we've found a true codec
try:
... | 3,163 | Python | .py | 79 | 31.43038 | 186 | 0.615911 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,441 | unsort.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/unsort.py | #!/usr/bin/env python
# randomize the lines of stdin or a file
import random, sys
def main():
if len(sys.argv) > 1:
fname = sys.argv[1]
inf = open(fname, 'r')
else:
inf = sys.stdin
lines = inf.readlines()
random.shuffle(lines)
sys.stdout.writelines(lines)
if __name__ == ... | 343 | Python | .py | 14 | 19.714286 | 40 | 0.601852 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,442 | passphrase.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/passphrase.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse, math, random
from pyutil.mathutil import div_ceil
from pkg_resources import resource_stream
def recursive_subset_sum(entropy_needed, wordlists):
# Pick a minimalish set of numbers which sum to at least
# entropy_needed.
# Okay now what's th... | 2,747 | Python | .py | 55 | 44.218182 | 193 | 0.690691 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,443 | lines.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/lines.py | #!/usr/bin/env python
# Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
from pyutil import lineutil
import sys
def main():
if len(sys.argv) > 1 and "-s" in sys.argv[1:]:
strip = True
sys.argv.remove("-s")
else:
strip = ... | 744 | Python | .py | 27 | 21.481481 | 67 | 0.583333 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,444 | time_comparisons.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/time_comparisons.py | # If you run this file, it will make up a random secret and then crack it
# using timing information from a string comparison function. Maybe--if it
# gets lucky. It takes a long, long time to work.
# So, the thing I need help with is statistics. The way this thing works is
# extremely stupid. Suppose you want to know... | 8,758 | Python | .py | 155 | 50.690323 | 425 | 0.688034 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,445 | tailx.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/tailx.py | #!/usr/bin/env python
# output all but the first N lines of a file
# Allen Short and Jp Calderone wrote this coool version:
import itertools, sys
def main():
K = int(sys.argv[1])
if len(sys.argv) > 2:
fname = sys.argv[2]
inf = open(fname, 'r')
else:
inf = sys.stdin
sys.stdout... | 593 | Python | .py | 24 | 21.583333 | 57 | 0.609236 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,446 | randfile.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/randfile.py | #!/usr/bin/env python
import os, sys
from random import randrange
import argparse
def main():
CHUNKSIZE=2**20
parser = argparse.ArgumentParser(prog="randfile", description="Create a file of pseudorandom bytes (not cryptographically secure).")
parser.add_argument('-b', '--num-bytes', help="how many byt... | 1,948 | Python | .py | 36 | 45.527778 | 200 | 0.6248 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,447 | memdump2dot.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/memdump2dot.py | #!/usr/bin/env python
import bindann
bindann.install_exception_handler()
import sys
inf = open(sys.argv[1], "r")
outf = open(sys.argv[1]+".dot", "w")
outf.write("digraph %s {\n" % sys.argv[1].replace(".",""))
def parse_netstring(l, i):
try:
j = l.find(':', i)
if j == -1:
return (Non... | 1,589 | Python | .py | 51 | 24.941176 | 105 | 0.511155 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,448 | verinfo.py | CouchPotato_CouchPotatoServer/libs/pyutil/scripts/verinfo.py | #!/usr/bin/env python
import exceptions
class UsageError(exceptions.Exception): pass
import sys
import pkg_resources
def main():
if len(sys.argv) <= 1:
raise UsageError, "USAGE: verinfo DISTRIBUTIONNAME [PACKAGENAME]"
DISTNAME=sys.argv[1]
if len(sys.argv) >= 3:
PACKNAME=sys.argv[2]
el... | 717 | Python | .py | 22 | 28.136364 | 73 | 0.638205 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,449 | debug_stuff.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/debug_stuff.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 7,682 | Python | .py | 188 | 29.207447 | 98 | 0.515995 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,450 | rr_cache.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/rr_cache.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 3,673 | Python | .py | 99 | 25.181818 | 74 | 0.528784 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,451 | lfu_cache_with_lock.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/lfu_cache_with_lock.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 5,486 | Python | .py | 140 | 22.65 | 74 | 0.456832 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,452 | lfu_cache.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/lfu_cache.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 4,799 | Python | .py | 133 | 23.421053 | 74 | 0.512798 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,453 | database_gevent.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/database_gevent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 949 | Python | .py | 24 | 38.083333 | 74 | 0.784314 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,454 | rr_cache_with_lock.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/rr_cache_with_lock.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 4,032 | Python | .py | 103 | 23.174757 | 74 | 0.470498 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,455 | database_super_thread_safe.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/database_super_thread_safe.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 3,903 | Python | .py | 92 | 34.641304 | 86 | 0.614614 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,456 | tree_index.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/tree_index.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 107,535 | Python | .py | 1,904 | 35.946429 | 151 | 0.488193 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,457 | sharded_index.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/sharded_index.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 3,765 | Python | .py | 92 | 32.880435 | 122 | 0.617301 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,458 | database_safe_shared.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/database_safe_shared.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 8,092 | Python | .py | 194 | 31.948454 | 79 | 0.586777 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,459 | hash_index.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/hash_index.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 33,813 | Python | .py | 769 | 29.462939 | 176 | 0.51623 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,460 | __init__.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 700 | Python | .py | 18 | 37.777778 | 74 | 0.747059 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,461 | storage.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/storage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 3,736 | Python | .py | 114 | 26.342105 | 81 | 0.608708 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,462 | patch.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/patch.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 2,770 | Python | .py | 73 | 32.684932 | 130 | 0.679146 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,463 | index.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/index.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 4,746 | Python | .py | 143 | 26.132867 | 80 | 0.634586 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,464 | migrate.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/migrate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 1,317 | Python | .py | 40 | 28.8 | 74 | 0.675314 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,465 | env.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/env.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 764 | Python | .py | 23 | 31.956522 | 74 | 0.756428 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,466 | indexcreator.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/indexcreator.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 25,444 | Python | .py | 556 | 31.663669 | 153 | 0.461067 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,467 | database_thread_safe.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/database_thread_safe.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 1,115 | Python | .py | 28 | 37.714286 | 75 | 0.774074 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,468 | database.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/database.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 42,585 | Python | .py | 1,066 | 28.879925 | 132 | 0.549878 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,469 | misc.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/misc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 971 | Python | .py | 28 | 32.428571 | 74 | 0.738248 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,470 | sharded_hash.py | CouchPotato_CouchPotatoServer/libs/CodernityDB/sharded_hash.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | 5,086 | Python | .py | 117 | 35.333333 | 84 | 0.625506 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,471 | client.py | CouchPotato_CouchPotatoServer/libs/deluge_client/client.py | import logging
import socket
import ssl
import struct
import warnings
import zlib
from .rencode import dumps, loads
RPC_RESPONSE = 1
RPC_ERROR = 2
RPC_EVENT = 3
MESSAGE_HEADER_SIZE = 5
READ_SIZE = 10
logger = logging.getLogger(__name__)
class DelugeClientException(Exception):
"""Base exception for all deluge ... | 10,080 | Python | .py | 228 | 31.802632 | 126 | 0.56818 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,472 | rencode.py | CouchPotato_CouchPotatoServer/libs/deluge_client/rencode.py | # Original bencode module by Petru Paler, et al.
#
# Modifications by Connelly Barnes:
#
# - Added support for floats (sent as 32-bit or 64-bit in network
# order), bools, None.
# - Allowed dict keys to be of any serializable type.
# - Lists/tuples are always decoded as tuples (thus, tuples can be
# used as di... | 13,391 | Python | .py | 377 | 30.734748 | 112 | 0.621429 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,473 | tests.py | CouchPotato_CouchPotatoServer/libs/deluge_client/tests.py | import os
import sys
import pytest
from .client import DelugeRPCClient, RemoteException
if sys.version_info > (3,):
long = int
@pytest.fixture
def client(request):
if sys.platform.startswith('win'):
auth_path = os.path.join(os.getenv('APPDATA'), 'deluge', 'auth')
else:
auth_path = os.p... | 1,783 | Python | .py | 45 | 33.133333 | 89 | 0.645518 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,474 | client.py | CouchPotato_CouchPotatoServer/libs/synchronousdeluge/client.py | import os
import platform
from collections import defaultdict
from itertools import imap
from synchronousdeluge.exceptions import DelugeRPCError
from synchronousdeluge.protocol import DelugeRPCRequest, DelugeRPCResponse
from synchronousdeluge.transfer import DelugeTransfer
__all__ = ["DelugeClient"]
RPC_RESPONSE =... | 5,078 | Python | .py | 123 | 30.829268 | 138 | 0.576282 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,475 | protocol.py | CouchPotato_CouchPotatoServer/libs/synchronousdeluge/protocol.py | __all__ = ["DelugeRPCRequest", "DelugeRPCResponse"]
class DelugeRPCRequest(object):
def __init__(self, request_id, method, *args, **kwargs):
self.request_id = request_id
self.method = method
self.args = args
self.kwargs = kwargs
def format(self):
return (self.request_id... | 957 | Python | .py | 29 | 25.344828 | 69 | 0.621328 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,476 | rencode.py | CouchPotato_CouchPotatoServer/libs/synchronousdeluge/rencode.py |
"""
rencode -- Web safe object pickling/unpickling.
Public domain, Connelly Barnes 2006-2007.
The rencode module is a modified version of bencode from the
BitTorrent project. For complex, heterogeneous data structures with
many small elements, r-encodings take up significantly less space than
b-encodings:
>>> len... | 12,982 | Python | .py | 374 | 29.938503 | 205 | 0.623237 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,477 | transfer.py | CouchPotato_CouchPotatoServer/libs/synchronousdeluge/transfer.py | import zlib
import struct
import socket
import ssl
from synchronousdeluge import rencode
__all__ = ["DelugeTransfer"]
class DelugeTransfer(object):
def __init__(self):
self.sock = None
self.conn = None
self.connected = False
def connect(self, hostport):
if self.connected:
... | 1,348 | Python | .py | 41 | 23 | 102 | 0.576297 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,478 | __init__.py | CouchPotato_CouchPotatoServer/libs/synchronousdeluge/__init__.py | """A synchronous implementation of the Deluge RPC protocol
based on gevent-deluge by Christopher Rosell.
https://github.com/chrippa/gevent-deluge
Example usage:
from synchronousdeluge import DelgueClient
client = DelugeClient()
client.connect()
# Wait for value
download_location = clie... | 569 | Python | .py | 15 | 34.4 | 79 | 0.771218 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,479 | exceptions.py | CouchPotato_CouchPotatoServer/libs/synchronousdeluge/exceptions.py | __all__ = ["DelugeRPCError"]
class DelugeRPCError(Exception):
def __init__(self, name, msg, traceback):
self.name = name
self.msg = msg
self.traceback = traceback
def __str__(self):
return "{0}: {1}: {2}".format(self.__class__.__name__, self.name, self.msg)
| 301 | Python | .py | 8 | 31.25 | 83 | 0.582759 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,480 | __init__.py | CouchPotato_CouchPotatoServer/libs/backports/__init__.py | # This is a Python "namespace package" http://www.python.org/dev/peps/pep-0382/
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| 155 | Python | .py | 3 | 50.666667 | 79 | 0.710526 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,481 | __init__.py | CouchPotato_CouchPotatoServer/libs/backports/ssl_match_hostname/__init__.py | """The match_hostname() function from Python 3.2, essential when using SSL."""
import re
__version__ = '3.2a3'
class CertificateError(ValueError):
pass
def _dnsname_to_pat(dn):
pats = []
for frag in dn.split(r'.'):
if frag == '*':
# When '*' is a fragment by itself, it matches a non-... | 2,139 | Python | .py | 54 | 30.351852 | 78 | 0.578644 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,482 | __init__.py | CouchPotato_CouchPotatoServer/libs/ndg/__init__.py | """ndg_httpsclient - PyOpenSSL utility to make a httplib-like interface suitable
for use with urllib2
This is a setuptools namespace_package. DO NOT place any other
code in this file! There is no guarantee that it will be installed
with easy_install. See:
http://peak.telecommunity.com/DevCenter/setuptools#namespac... | 653 | Python | .py | 15 | 42.333333 | 80 | 0.738583 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,483 | ssl_peer_verification.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/ssl_peer_verification.py | """ndg_httpsclient - module containing SSL peer verification class.
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "09/12/11"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = '$Id... | 9,661 | Python | .py | 204 | 34.539216 | 84 | 0.580617 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,484 | ssl_context_util.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/ssl_context_util.py | """ndg_httpsclient SSL Context utilities module containing convenience routines
for setting SSL context configuration.
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "09/12/11"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact... | 3,458 | Python | .py | 77 | 36.636364 | 82 | 0.671575 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,485 | urllib2_build_opener.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/urllib2_build_opener.py | """urllib2 style build opener integrates with HTTPSConnection class from this
package.
"""
__author__ = "P J Kershaw"
__date__ = "21/12/10"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revis... | 2,689 | Python | .py | 64 | 33.015625 | 80 | 0.654188 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,486 | subj_alt_name.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/subj_alt_name.py | """NDG HTTPS Client package
Use pyasn1 to provide support for parsing ASN.1 formatted subjectAltName
content for SSL peer verification. Code based on:
http://stackoverflow.com/questions/5519958/how-do-i-parse-subjectaltname-extension-data-using-pyasn1
"""
__author__ = "P J Kershaw"
__date__ = "01/02/12"
__copyright_... | 6,131 | Python | .py | 121 | 39.652893 | 100 | 0.62521 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,487 | https.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/https.py | """ndg_httpsclient HTTPS module containing PyOpenSSL implementation of
httplib.HTTPSConnection
PyOpenSSL utility to make a httplib-like interface suitable for use with
urllib2
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "09/12/11"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ =... | 4,834 | Python | .py | 105 | 35.8 | 83 | 0.641358 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,488 | utils.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/utils.py | """Utilities using NDG HTTPS Client, including a main module that can be used to
fetch from a URL.
"""
__author__ = "R B Wilkinson"
__date__ = "09/12/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.... | 15,736 | Python | .py | 359 | 33.367688 | 82 | 0.620608 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,489 | __init__.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/__init__.py | """ndg_httpsclient - PyOpenSSL utility to make a httplib-like interface suitable
for use with urllib2
"""
__author__ = "P J Kershaw (STFC) and Richard Wilkinson (Tessella)"
__date__ = "09/12/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level direc... | 390 | Python | .py | 9 | 42.333333 | 80 | 0.708661 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,490 | ssl_socket.py | CouchPotato_CouchPotatoServer/libs/ndg/httpsclient/ssl_socket.py | """PyOpenSSL utilities including HTTPSSocket class which wraps PyOpenSSL
SSL connection into a httplib-like interface suitable for use with urllib2
"""
__author__ = "P J Kershaw"
__date__ = "21/12/10"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-leve... | 9,344 | Python | .py | 228 | 32.280702 | 80 | 0.629945 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,491 | guess.py | CouchPotato_CouchPotatoServer/libs/guessit/guess.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | 11,011 | Python | .py | 270 | 32.288889 | 110 | 0.598983 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,492 | slogging.py | CouchPotato_CouchPotatoServer/libs/guessit/slogging.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Smewt - A smart collection manager
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# Smewt 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 versio... | 3,388 | Python | .py | 77 | 34.792208 | 101 | 0.592907 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,493 | __main__.py | CouchPotato_CouchPotatoServer/libs/guessit/__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | 6,835 | Python | .py | 108 | 51.481481 | 160 | 0.622743 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,494 | patterns.py | CouchPotato_CouchPotatoServer/libs/guessit/patterns.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
# Copyright (c) 2011 Ricard Marxer <ricardmp@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesse... | 10,301 | Python | .py | 186 | 40.666667 | 122 | 0.472391 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,495 | language.py | CouchPotato_CouchPotatoServer/libs/guessit/language.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | 14,207 | Python | .py | 317 | 35.624606 | 110 | 0.588693 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,496 | hash_ed2k.py | CouchPotato_CouchPotatoServer/libs/guessit/hash_ed2k.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | 2,039 | Python | .py | 55 | 30.654545 | 74 | 0.639311 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,497 | textutils.py | CouchPotato_CouchPotatoServer/libs/guessit/textutils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Smewt - A smart collection manager
# Copyright (c) 2008-2012 Nicolas Wack <wackou@gmail.com>
#
# Smewt 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 v... | 6,238 | Python | .py | 167 | 30.568862 | 85 | 0.571832 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,498 | matchtree.py | CouchPotato_CouchPotatoServer/libs/guessit/matchtree.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | 9,116 | Python | .py | 229 | 29.0131 | 79 | 0.569147 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |
7,499 | date.py | CouchPotato_CouchPotatoServer/libs/guessit/date.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | 4,095 | Python | .py | 110 | 29.363636 | 77 | 0.564361 | CouchPotato/CouchPotatoServer | 3,869 | 1,214 | 1,266 | GPL-3.0 | 9/5/2024, 5:10:17 PM (Europe/Amsterdam) |