text stringlengths 0 1.05M | meta dict |
|---|---|
__version__=''' $Id$ '''
__doc__ = """
This module contains the script for building the user guide.
"""
def run(pagesize=None, verbose=0, outDir=None):
import sys,os
from reportlab.lib.utils import open_and_read
cwd = os.getcwd()
docsDir=os.path.dirname(os.path.dirname(sys.argv[0]) or cwd)
topDir=o... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "docs/userguide/genuserguide.py",
"copies": "1",
"size": "3475",
"license": "bsd-3-clause",
"hash": 6953227713798371000,
"line_mean": 32.4134615385,
"line_max": 119,
"alpha_frac": 0.6302158273,
"autogenerated": false,
"ratio": 3.3317353787... |
__version__=''' $Id: genuserguide.py 2900 2006-05-22 21:49:00Z andy $ '''
__doc__ = """
This module contains the script for building the user guide.
"""
def run(pagesize=None, verbose=0, outDir=None):
import os
from reportlab.tools.docco.rl_doc_utils import setStory, getStory, RLDocTemplate, defaultPageSize
... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/docs/userguide/genuserguide.py",
"copies": "2",
"size": "2805",
"license": "bsd-3-clause",
"hash": -6666289960836878000,
"line_mean": 32,
"line_max": 119,
"alpha_frac": 0.6156862745,
"autogenerated": false,
"ratio": 3.37... |
__version__=''' $Id: genuserguide.py 3376 2009-01-19 12:05:41Z jonas $ '''
__doc__ = """
This module contains the script for building the user guide.
"""
def run(pagesize=None, verbose=0, outDir=None):
import sys,os
from reportlab.lib.utils import open_and_read
cwd = os.getcwd()
docsDir=os.path.dirname... | {
"repo_name": "HM2MC/Webfront",
"path": "reportlab-2.5/docs/userguide/genuserguide.py",
"copies": "5",
"size": "3525",
"license": "mit",
"hash": 1641835211827159800,
"line_mean": 32.8942307692,
"line_max": 119,
"alpha_frac": 0.6320567376,
"autogenerated": false,
"ratio": 3.3098591549295775,
"co... |
__version__=''' $Id $ '''
__doc__="""Defines some standard drawings to use as test cases
This contains a number of routines to generate test drawings
for reportlab/graphics. For now they are contrived, but we will expand them
to try and trip up any parser. Feel free to add more.
"""
from reportlab.graphics.shapes i... | {
"repo_name": "blampe/M2M",
"path": "reportlab-2.5/src/reportlab/graphics/testdrawings.py",
"copies": "15",
"size": "9451",
"license": "mit",
"hash": -7661512556982924000,
"line_mean": 30.9290540541,
"line_max": 113,
"alpha_frac": 0.5522166966,
"autogenerated": false,
"ratio": 2.994613434727503,
... |
__version__=''' $Id$ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'mappings' between the font family name and th... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "src/reportlab/lib/fonts.py",
"copies": "1",
"size": "3461",
"license": "bsd-3-clause",
"hash": 1605009163306834000,
"line_mean": 35.0520833333,
"line_max": 101,
"alpha_frac": 0.5593759029,
"autogenerated": false,
"ratio": 3.21355617455896... |
__version__=''' $Id: fonts.py 2385 2004-06-17 15:26:05Z rgbecker $ '''
import string, sys, os
###############################################################################
# A place to put useful font stuff
###############################################################################
#
# Font Mappings
# The ... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/lib/reportlab/lib/fonts.py",
"copies": "2",
"size": "3232",
"license": "bsd-3-clause",
"hash": -7218119713631977000,
"line_mean": 35.3146067416,
"line_max": 101,
"alpha_frac": 0.5377475248,
"autogenerated": false,
"ratio": 3.0987535953... |
__version__=''' $Id: fonts.py 3342 2008-12-12 15:55:34Z andy $ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'map... | {
"repo_name": "fergalmoran/Chrome2Kindle",
"path": "server/reportlab/lib/fonts.py",
"copies": "4",
"size": "3503",
"license": "mit",
"hash": 3362500577369047000,
"line_mean": 35.4895833333,
"line_max": 101,
"alpha_frac": 0.5612332287,
"autogenerated": false,
"ratio": 3.196167883211679,
"config_... |
__version__=''' $Id: fonts.py 3702 2010-04-14 17:13:41Z rgbecker $ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep ... | {
"repo_name": "HM2MC/Webfront",
"path": "reportlab-2.5/src/reportlab/lib/fonts.py",
"copies": "10",
"size": "3480",
"license": "mit",
"hash": -2144558250970201900,
"line_mean": 36.4193548387,
"line_max": 101,
"alpha_frac": 0.5614942529,
"autogenerated": false,
"ratio": 3.2222222222222223,
"conf... |
__all__=('Formatter','DecimalFormatter')
__version__=''' $Id$ '''
__doc__="""
These help format numbers and dates in a user friendly way.
Used by the graphics framework.
"""
import string, sys, os, re
class Formatter:
"Base formatter - simply applies python format strings"
def __init__(self, pattern):
... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "src/reportlab/lib/formatters.py",
"copies": "1",
"size": "3838",
"license": "bsd-3-clause",
"hash": 6286331022934565000,
"line_mean": 34.2110091743,
"line_max": 159,
"alpha_frac": 0.5419489317,
"autogenerated": false,
"ratio": 3.445242369... |
__all__=('Formatter','DecimalFormatter')
__version__=''' $Id: formatters.py 3155 2007-10-05 10:55:52Z rgbecker $ '''
__doc__="""
These help format numbers and dates in a user friendly way.
Used by the graphics framework.
"""
import string, sys, os, re
class Formatter:
"Base formatter - simply applies python format... | {
"repo_name": "blampe/M2M",
"path": "reportlab-2.5/build/lib.win32-2.7/reportlab/lib/formatters.py",
"copies": "14",
"size": "3889",
"license": "mit",
"hash": 7112474830159207000,
"line_mean": 34.6788990826,
"line_max": 159,
"alpha_frac": 0.5448701466,
"autogenerated": false,
"ratio": 3.429453262... |
__version__=''' $Id: formatters.py 2385 2004-06-17 15:26:05Z rgbecker $ '''
__doc__="""
These help format numbers and dates in a user friendly way.
Used by the graphics framework.
"""
import string, sys, os
class Formatter:
"Base formatter - simply applies python format strings"
def __init__(self, pattern):
... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/lib/formatters.py",
"copies": "2",
"size": "3494",
"license": "bsd-3-clause",
"hash": -3587979002399374000,
"line_mean": 33.95,
"line_max": 159,
"alpha_frac": 0.5420721236,
"autogenerated": false,
"ratio": 3.449160908193... |
__version__=''' $Id$ '''
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
'''
def __init__(self):
self... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "src/reportlab/lib/logger.py",
"copies": "1",
"size": "1787",
"license": "bsd-3-clause",
"hash": -5733478858312697000,
"line_mean": 28.3114754098,
"line_max": 102,
"alpha_frac": 0.5842193621,
"autogenerated": false,
"ratio": 3.581162324649... |
__version__=''' $Id: logger.py 2385 2004-06-17 15:26:05Z rgbecker $ '''
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
'''
def __init__(self):
self._fps = [stderr]
sel... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/lib/reportlab/lib/logger.py",
"copies": "2",
"size": "1759",
"license": "bsd-3-clause",
"hash": -3797249120930019000,
"line_mean": 27.8524590164,
"line_max": 102,
"alpha_frac": 0.5798749289,
"autogenerated": false,
"ratio": 3.497017892... |
__version__=''' $Id: logger.py 3342 2008-12-12 15:55:34Z andy $ '''
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
... | {
"repo_name": "commtrack/commtrack-core",
"path": "reportlab/lib/logger.py",
"copies": "4",
"size": "1830",
"license": "bsd-3-clause",
"hash": 2129925431217536800,
"line_mean": 29.0163934426,
"line_max": 102,
"alpha_frac": 0.587431694,
"autogenerated": false,
"ratio": 3.5328185328185326,
"confi... |
__version__=''' $Id: logger.py 3662 2010-02-09 11:23:58Z rgbecker $ '''
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write meth... | {
"repo_name": "blampe/M2M",
"path": "reportlab-2.5/src/reportlab/lib/logger.py",
"copies": "10",
"size": "1820",
"license": "mit",
"hash": 325630631255895940,
"line_mean": 28.8360655738,
"line_max": 102,
"alpha_frac": 0.5873626374,
"autogenerated": false,
"ratio": 3.5686274509803924,
"config_te... |
"""This module defines a few common page sizes in points (1/72 inch).
To be expanded to include things like label sizes, envelope windows
etc."""
__version__=''' $Id: pagesizes.py 2385 2004-06-17 15:26:05Z rgbecker $ '''
from reportlab.lib.units import cm, inch
_W, _H = (21*cm, 29.7*cm)
A6 = (_W*.5, _H*.5)
A5 = (_H... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/lib/pagesizes.py",
"copies": "16",
"size": "1332",
"license": "bsd-3-clause",
"hash": -7253254820647825000,
"line_mean": 23.2363636364,
"line_max": 105,
"alpha_frac": 0.6051051051,
"autogenerated": false,
"ratio": 2.4086... |
import types
import string
def __set_coerce(t, S):
if t is types.ListType:
return list(S)
elif t is types.TupleType:
return tuple(S)
elif t is types.StringType:
return string.join(S, '')
return S
def unique(seq):
result = []
for i in seq:
if i not in result:
... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/lib/reportlab/lib/set_ops.py",
"copies": "3",
"size": "1214",
"license": "bsd-3-clause",
"hash": -4373462258959683000,
"line_mean": 30.9473684211,
"line_max": 103,
"alpha_frac": 0.6416803954,
"autogenerated": false,
"ratio": 3.12886597... |
__version__=''' $Id$ '''
__doc__="""From before Python had a Set class..."""
import types
import string
def __set_coerce(t, S):
if t is types.ListType:
return list(S)
elif t is types.TupleType:
return tuple(S)
elif t is types.StringType:
return string.join(S, '')
return S
def ... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "src/reportlab/lib/set_ops.py",
"copies": "1",
"size": "1292",
"license": "bsd-3-clause",
"hash": 3519258075154644000,
"line_mean": 30.512195122,
"line_max": 103,
"alpha_frac": 0.6339009288,
"autogenerated": false,
"ratio": 3.1359223300970... |
__version__=''' $Id: set_ops.py 3342 2008-12-12 15:55:34Z andy $ '''
__doc__="""From before Python had a Set class..."""
import types
import string
def __set_coerce(t, S):
if t is types.ListType:
return list(S)
elif t is types.TupleType:
return tuple(S)
elif t is types.StringType:
... | {
"repo_name": "jhurt/ReportLab",
"path": "src/reportlab/lib/set_ops.py",
"copies": "14",
"size": "1336",
"license": "bsd-3-clause",
"hash": 696003438522471000,
"line_mean": 31.5853658537,
"line_max": 103,
"alpha_frac": 0.6362275449,
"autogenerated": false,
"ratio": 3.0854503464203233,
"config_t... |
__version__=''' $Id'''
__doc__="""most basic test possible that makes a PDF.
Useful if you want to test that a really minimal PDF is healthy,
since the output is about the smallest thing we can make."""
from reportlab.test import unittest
from reportlab.test.utils import makeSuiteForClasses, outputfile, printLocation... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/test/test_hello.py",
"copies": "2",
"size": "1721",
"license": "bsd-3-clause",
"hash": -4233100422529650700,
"line_mean": 33.42,
"line_max": 144,
"alpha_frac": 0.6682161534,
"autogenerated": false,
"ratio": 3.21082089552... |
__version__=''' $Id: test_pdfgen_callback.py 2619 2005-06-24 14:49:15Z rgbecker $ '''
__doc__='checks callbacks work'
from reportlab.test import unittest
from reportlab.test.utils import makeSuiteForClasses, outputfile, printLocation
from reportlab.pdfgen.canvas import Canvas
from reportlab.test.test_pdfgen_general i... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/lib/reportlab/test/test_pdfgen_callback.py",
"copies": "2",
"size": "1172",
"license": "bsd-3-clause",
"hash": -6026702034190592000,
"line_mean": 29.0512820513,
"line_max": 117,
"alpha_frac": 0.726109215,
"autogenerated": false,
"ratio... |
__version__=''' $Id$ '''
__doc__ = """
This module contains utilities for generating guides
"""
import os, sys, glob
import string
from rltemplate import RLDocTemplate
from stylesheet import getStyleSheet
styleSheet = getStyleSheet()
#from reportlab.platypus.doctemplate import SimpleDocTemplate
from reportlab.lib.... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "tools/docco/rl_doc_utils.py",
"copies": "1",
"size": "13717",
"license": "bsd-3-clause",
"hash": -3998611035502241000,
"line_mean": 32.0530120482,
"line_max": 116,
"alpha_frac": 0.610847853,
"autogenerated": false,
"ratio": 3.535309278350... |
__version__=''' $Id: rl_doc_utils.py 2830 2006-04-05 15:18:32Z rgbecker $ '''
__doc__ = """
This module contains utilities for generating guides
"""
import os, sys, glob
import string
from rltemplate import RLDocTemplate
from stylesheet import getStyleSheet
styleSheet = getStyleSheet()
#from reportlab.platypus.doc... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/tools/docco/rl_doc_utils.py",
"copies": "2",
"size": "13632",
"license": "bsd-3-clause",
"hash": 6698147133558988000,
"line_mean": 32.1678832117,
"line_max": 116,
"alpha_frac": 0.6101819249,
"autogenerated": false,
"rati... |
__version__=''' $Id: rl_doc_utils.py 3372 2009-01-15 16:59:35Z jonas $ '''
__doc__ = """
This module contains utilities for generating guides
"""
import os, sys, glob
import string
from rltemplate import RLDocTemplate
from stylesheet import getStyleSheet
styleSheet = getStyleSheet()
#from reportlab.platypus.doctem... | {
"repo_name": "jhurt/ReportLab",
"path": "tools/docco/rl_doc_utils.py",
"copies": "5",
"size": "13767",
"license": "bsd-3-clause",
"hash": 961311721831800800,
"line_mean": 32.1734939759,
"line_max": 116,
"alpha_frac": 0.6112442798,
"autogenerated": false,
"ratio": 3.5263831967213113,
"config_te... |
__version__=''' $Id'''
__doc__="""Tests of intra-paragraph parsing behaviour in Platypus."""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile
setOutDir(__name__)
from types import TupleType, ListType, StringType, UnicodeType
from pprint import pprint as pp
import unittest
from reportlab.pla... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "tests/test_platypus_paraparser.py",
"copies": "1",
"size": "4414",
"license": "bsd-3-clause",
"hash": -2758403252380414500,
"line_mean": 38.0619469027,
"line_max": 93,
"alpha_frac": 0.6411418215,
"autogenerated": false,
"ratio": 3.6210008... |
__version__='''$Id$'''
__doc__="""most basic test possible that makes a PDF.
Useful if you want to test that a really minimal PDF is healthy,
since the output is about the smallest thing we can make."""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
imp... | {
"repo_name": "makinacorpus/reportlab-ecomobile",
"path": "tests/test_hello.py",
"copies": "1",
"size": "1624",
"license": "bsd-3-clause",
"hash": -2190175808559373600,
"line_mean": 32.8333333333,
"line_max": 144,
"alpha_frac": 0.6594827586,
"autogenerated": false,
"ratio": 3.241516966067864,
"... |
__version__=''' $Id: test_pdfgen_pycanvas.py 2619 2005-06-24 14:49:15Z rgbecker $ '''
__doc__='testscript for reportlab.pdfgen'
#tests and documents new low-level canvas and the pycanvas module to output Python source code.
import string, os
from reportlab.test import unittest
from reportlab.test.utils import makeSui... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/lib/reportlab/test/test_pdfgen_pycanvas.py",
"copies": "2",
"size": "27504",
"license": "bsd-3-clause",
"hash": 6027821055394293000,
"line_mean": 33.8151898734,
"line_max": 132,
"alpha_frac": 0.6212914485,
"autogenerated": false,
"rati... |
__version__='''$Id: test_utils.py 2619 2005-06-24 14:49:15Z rgbecker $'''
__doc__="""Test reportlab.lib.util module"""
from reportlab.test import unittest
from reportlab.test.utils import makeSuiteForClasses, outputfile, printLocation
class FmtTestCase(unittest.TestCase):
def testFmt(self):
from reportl... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/test/test_utils.py",
"copies": "2",
"size": "1251",
"license": "bsd-3-clause",
"hash": -4262933882406708700,
"line_mean": 32.8108108108,
"line_max": 99,
"alpha_frac": 0.6099120703,
"autogenerated": false,
"ratio": 3.475,... |
__doc__="""Verfy that if in invariant mode, repeated runs
make identical file. This does NOT test across platforms
or python versions, only a user can do that :-)"""
__version__='''$Id: test_invariant.py 3291 2008-09-15 13:21:33Z rgbecker $'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfi... | {
"repo_name": "blampe/M2M",
"path": "reportlab-2.5/tests/test_invariant.py",
"copies": "5",
"size": "1972",
"license": "mit",
"hash": 7928097562800342000,
"line_mean": 34.2142857143,
"line_max": 92,
"alpha_frac": 0.6531440162,
"autogenerated": false,
"ratio": 3.6051188299817185,
"config_test": ... |
__doc__='testscript for reportlab.pdfgen'
__version__=''' $Id$ '''
#tests and documents new low-level canvas
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import os
import unittest
from reportlab.pdfgen import canvas # gmcm 2000/10/13, pdfgen now a pa... | {
"repo_name": "malexandre/python-xhtml2pdf-demo",
"path": "reportlab/tests/test_pdfgen_general.py",
"copies": "2",
"size": "42634",
"license": "mit",
"hash": 5250740514906941000,
"line_mean": 36.3327495622,
"line_max": 132,
"alpha_frac": 0.6042126003,
"autogenerated": false,
"ratio": 3.0546679085... |
__doc__='testscript for reportlab.pdfgen'
__version__=''' $Id: test_pdfgen_general.py 3959 2012-09-27 14:39:39Z robin $ '''
#tests and documents new low-level canvas
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import os, string
from io import BytesIO
... | {
"repo_name": "nakagami/reportlab",
"path": "tests/test_pdfgen_general.py",
"copies": "1",
"size": "41309",
"license": "bsd-3-clause",
"hash": -2068205823307980500,
"line_mean": 36.0816876122,
"line_max": 132,
"alpha_frac": 0.6027015905,
"autogenerated": false,
"ratio": 3.049534918056991,
"conf... |
__doc__="""Tests Postscript XObjects.
Nothing visiblke in Acrobat, but the resulting files
contain graphics and tray commands if exported to
a Postscript device in Acrobat 4.0"""
__version__='''$Id: test_pdfbase_postscript.py 3959 2012-09-27 14:39:39Z robin $'''
from reportlab.lib.testutils import setOutDir,makeSuiteF... | {
"repo_name": "nakagami/reportlab",
"path": "tests/test_pdfbase_postscript.py",
"copies": "1",
"size": "3243",
"license": "bsd-3-clause",
"hash": 4217397577402649000,
"line_mean": 42.24,
"line_max": 113,
"alpha_frac": 0.6854764107,
"autogenerated": false,
"ratio": 3.5794701986754967,
"config_te... |
__doc__="""Verfy that if in invariant mode, repeated runs
make identical file. This does NOT test across platforms
or python versions, only a user can do that :-)"""
__version__='''$Id$'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import unittest
... | {
"repo_name": "kanarelo/reportlab",
"path": "tests/test_invariant.py",
"copies": "13",
"size": "1971",
"license": "bsd-3-clause",
"hash": -1674485512850885400,
"line_mean": 33.5789473684,
"line_max": 92,
"alpha_frac": 0.6529680365,
"autogenerated": false,
"ratio": 3.670391061452514,
"config_tes... |
__version__=''' $Id$ '''
__doc__ = """
This module contains the script for building the reference.
"""
def run(verbose=None, outDir=None):
import os, sys, shutil
if verbose is None: verbose=('-s' not in sys.argv)
cwd = os.getcwd()
docsDir=os.path.dirname(os.path.dirname(sys.argv[0]) or cwd)
topDir=o... | {
"repo_name": "malexandre/python-xhtml2pdf-demo",
"path": "reportlab/docs/reference/genreference.py",
"copies": "14",
"size": "1238",
"license": "mit",
"hash": -3969482777109096400,
"line_mean": 38.935483871,
"line_max": 119,
"alpha_frac": 0.7084006462,
"autogenerated": false,
"ratio": 3.35501355... |
__version__=''' $Id: genreference.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__ = """
This module contains the script for building the reference.
"""
def run(verbose=None, outDir=None):
import os, sys, shutil
if verbose is None: verbose=('-s' not in sys.argv)
cwd = os.getcwd()
docsDir=os.path.dirname... | {
"repo_name": "nakagami/reportlab",
"path": "docs/reference/genreference.py",
"copies": "1",
"size": "1288",
"license": "bsd-3-clause",
"hash": 8410976961813490000,
"line_mean": 40.5483870968,
"line_max": 119,
"alpha_frac": 0.7104037267,
"autogenerated": false,
"ratio": 3.3110539845758353,
"con... |
__version__=''' $Id$ '''
__doc__ = """
This module contains the script for building the user guide.
"""
def run(pagesize=None, verbose=0, outDir=None):
import sys,os
from reportlab.lib.utils import open_and_read
cwd = os.getcwd()
docsDir=os.path.dirname(os.path.dirname(sys.argv[0]) or cwd)
topDir=o... | {
"repo_name": "MatthewWilkes/reportlab",
"path": "docs/userguide/genuserguide.py",
"copies": "1",
"size": "3475",
"license": "bsd-3-clause",
"hash": -2453458389207675400,
"line_mean": 32.4134615385,
"line_max": 119,
"alpha_frac": 0.6302158273,
"autogenerated": false,
"ratio": 3.3317353787152446,
... |
__version__=''' $Id: genuserguide.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__ = """
This module contains the script for building the user guide.
"""
import sys
import os
def run(pagesize=None, verbose=0, outDir=None):
from reportlab.lib.utils import open_and_read
cwd = os.getcwd()
docsDir=os.path.dirn... | {
"repo_name": "nakagami/reportlab",
"path": "docs/userguide/genuserguide.py",
"copies": "1",
"size": "3504",
"license": "bsd-3-clause",
"hash": 5315776458833208000,
"line_mean": 32.6923076923,
"line_max": 119,
"alpha_frac": 0.6304223744,
"autogenerated": false,
"ratio": 3.3213270142180096,
"con... |
__version__=''' $Id $ '''
__doc__="""Defines some standard drawings to use as test cases
This contains a number of routines to generate test drawings
for reportlab/graphics. For now they are contrived, but we will expand them
to try and trip up any parser. Feel free to add more.
"""
from reportlab.graphics.shapes i... | {
"repo_name": "nakagami/reportlab",
"path": "src/reportlab/graphics/testdrawings.py",
"copies": "4",
"size": "9451",
"license": "bsd-3-clause",
"hash": 8383786577914557000,
"line_mean": 30.9290540541,
"line_max": 113,
"alpha_frac": 0.5522166966,
"autogenerated": false,
"ratio": 2.994613434727503,... |
__version__=''' $Id$ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'mappings' between the font family name and th... | {
"repo_name": "kitanata/resume",
"path": "env/lib/python2.7/site-packages/reportlab/lib/fonts.py",
"copies": "5",
"size": "3434",
"license": "mit",
"hash": 6417253024129697000,
"line_mean": 35.9247311828,
"line_max": 101,
"alpha_frac": 0.559114735,
"autogenerated": false,
"ratio": 3.2396226415094... |
__version__=''' $Id: fonts.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'ma... | {
"repo_name": "nakagami/reportlab",
"path": "src/reportlab/lib/fonts.py",
"copies": "1",
"size": "3477",
"license": "bsd-3-clause",
"hash": 3021989208330527000,
"line_mean": 36.3870967742,
"line_max": 101,
"alpha_frac": 0.5611159045,
"autogenerated": false,
"ratio": 3.2224281742354033,
"config_... |
__all__=('Formatter','DecimalFormatter')
__version__=''' $Id: formatters.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="""
These help format numbers and dates in a user friendly way.
Used by the graphics framework.
"""
import string, sys, os, re
class Formatter:
"Base formatter - simply applies python format st... | {
"repo_name": "nakagami/reportlab",
"path": "src/reportlab/lib/formatters.py",
"copies": "1",
"size": "3887",
"license": "bsd-3-clause",
"hash": -3260313173013546500,
"line_mean": 34.6605504587,
"line_max": 160,
"alpha_frac": 0.5443786982,
"autogenerated": false,
"ratio": 3.4307149161518096,
"c... |
__version__=''' $Id$ '''
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
'''
def __init__(self):
self... | {
"repo_name": "Distrotech/reportlab",
"path": "src/reportlab/lib/logger.py",
"copies": "30",
"size": "1765",
"license": "bsd-3-clause",
"hash": 7536803169280182000,
"line_mean": 27.9344262295,
"line_max": 102,
"alpha_frac": 0.5824362606,
"autogenerated": false,
"ratio": 3.6168032786885247,
"con... |
__version__=''' $Id: logger.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
... | {
"repo_name": "nakagami/reportlab",
"path": "src/reportlab/lib/logger.py",
"copies": "1",
"size": "1817",
"license": "bsd-3-clause",
"hash": -415814347602349300,
"line_mean": 28.7868852459,
"line_max": 102,
"alpha_frac": 0.5866813429,
"autogenerated": false,
"ratio": 3.569744597249509,
"config_... |
"""This module defines a few common page sizes in points (1/72 inch).
To be expanded to include things like label sizes, envelope windows
etc."""
__version__=''' $Id: pagesizes.py 3959 2012-09-27 14:39:39Z robin $ '''
from reportlab.lib.units import cm, inch
_W, _H = (21*cm, 29.7*cm)
A6 = (_W*.5, _H*.5)
A5 = (_H*.5... | {
"repo_name": "nakagami/reportlab",
"path": "src/reportlab/lib/pagesizes.py",
"copies": "1",
"size": "1329",
"license": "bsd-3-clause",
"hash": 3013306944194645500,
"line_mean": 23.1818181818,
"line_max": 105,
"alpha_frac": 0.6042136945,
"autogenerated": false,
"ratio": 2.407608695652174,
"conf... |
__version__=''' $Id$ '''
__doc__="""From before Python had a Set class..."""
import types
def __set_coerce(t, S):
if t is list:
return list(S)
elif t is tuple:
return tuple(S)
elif t is bytes:
return ''.join(S)
return S
def unique(seq):
result = []
for i in seq:
... | {
"repo_name": "kitanata/resume",
"path": "env/lib/python2.7/site-packages/reportlab/lib/set_ops.py",
"copies": "2",
"size": "1188",
"license": "mit",
"hash": -851520855840164400,
"line_mean": 28.7,
"line_max": 103,
"alpha_frac": 0.611952862,
"autogenerated": false,
"ratio": 3.0618556701030926,
... |
__version__=''' $Id: set_ops.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="""From before Python had a Set class..."""
import types
import string
def __set_coerce(t, S):
if t is types.ListType:
return list(S)
elif t is types.TupleType:
return tuple(S)
elif t is types.StringType:
... | {
"repo_name": "nakagami/reportlab",
"path": "src/reportlab/lib/set_ops.py",
"copies": "1",
"size": "1337",
"license": "bsd-3-clause",
"hash": -3136483610296246000,
"line_mean": 31.6097560976,
"line_max": 103,
"alpha_frac": 0.636499626,
"autogenerated": false,
"ratio": 3.087759815242494,
"config... |
__version__=''' $Id$ '''
__doc__ = """
This module contains utilities for generating guides
"""
import os, sys, glob
import string
from reportlab.lib.utils import asUnicode
from .rltemplate import RLDocTemplate
from .stylesheet import getStyleSheet
styleSheet = getStyleSheet()
#from reportlab.platypus.doctemplate i... | {
"repo_name": "malexandre/python-xhtml2pdf-demo",
"path": "reportlab/tools/docco/rl_doc_utils.py",
"copies": "1",
"size": "13797",
"license": "mit",
"hash": 7496536265566278000,
"line_mean": 32.2457831325,
"line_max": 116,
"alpha_frac": 0.6130318185,
"autogenerated": false,
"ratio": 3.53950743971... |
__version__=''' $Id$ '''
__doc__ = """
This module contains utilities for generating guides
"""
import os, sys, glob
import string
from rltemplate import RLDocTemplate
from stylesheet import getStyleSheet
styleSheet = getStyleSheet()
#from reportlab.platypus.doctemplate import SimpleDocTemplate
from reportlab.lib.... | {
"repo_name": "MatthewWilkes/reportlab",
"path": "tools/docco/rl_doc_utils.py",
"copies": "1",
"size": "13787",
"license": "bsd-3-clause",
"hash": 4111771459062109700,
"line_mean": 32.1418269231,
"line_max": 116,
"alpha_frac": 0.6123884819,
"autogenerated": false,
"ratio": 3.538757700205339,
"c... |
__version__=''' $Id: rl_doc_utils.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__ = """
This module contains utilities for generating guides
"""
import os, sys, glob
import string
from tools.docco.rltemplate import RLDocTemplate
from tools.docco.stylesheet import getStyleSheet
styleSheet = getStyleSheet()
#from ... | {
"repo_name": "nakagami/reportlab",
"path": "src/tools/docco/rl_doc_utils.py",
"copies": "1",
"size": "13847",
"license": "bsd-3-clause",
"hash": -5559132138749244000,
"line_mean": 32.2860576923,
"line_max": 116,
"alpha_frac": 0.6132014155,
"autogenerated": false,
"ratio": 3.5225133553803105,
"... |
__version__=''' $Id'''
__doc__="""Tests of intra-paragraph parsing behaviour in Platypus."""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile
setOutDir(__name__)
from pprint import pprint as pp
import sys
import unittest
from reportlab.platypus import cleanBlockQuotedText
from reportlab.pla... | {
"repo_name": "nakagami/reportlab",
"path": "tests/test_platypus_paraparser.py",
"copies": "1",
"size": "4759",
"license": "bsd-3-clause",
"hash": -4857605608161601000,
"line_mean": 37.072,
"line_max": 88,
"alpha_frac": 0.63437697,
"autogenerated": false,
"ratio": 3.610773899848255,
"config_tes... |
__version__='''$Id$'''
__doc__="""Testing to encrypt a very minimal pdf using a Canvas and a DocTemplate.
TODO: Automatiocally test that this pdf is really encrypted.
"""
import unittest
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
from reportlab.pdfg... | {
"repo_name": "MatthewWilkes/reportlab",
"path": "tests/test_encrypt.py",
"copies": "1",
"size": "2159",
"license": "bsd-3-clause",
"hash": 6342006779204120000,
"line_mean": 35.593220339,
"line_max": 96,
"alpha_frac": 0.6956924502,
"autogenerated": false,
"ratio": 4.073584905660377,
"config_tes... |
__version__=''' $Id$ '''
__doc__='Test script for reportlab.tables'
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import os,unittest
from reportlab.platypus import Spacer, SimpleDocTemplate, Table, TableStyle
from reportlab.platypus.paragraph import Par... | {
"repo_name": "MatthewWilkes/reportlab",
"path": "tests/test_platypus_tables.py",
"copies": "1",
"size": "37531",
"license": "bsd-3-clause",
"hash": -7168478941363402000,
"line_mean": 42.8959064327,
"line_max": 216,
"alpha_frac": 0.5192773974,
"autogenerated": false,
"ratio": 3.1138305815979423,
... |
__version__='''$Id: test_encrypt.py 3959 2012-09-27 14:39:39Z robin $'''
__doc__="""Testing to encrypt a very minimal pdf using a Canvas and a DocTemplate.
TODO: Automatiocally test that this pdf is really encrypted.
"""
import unittest
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, pri... | {
"repo_name": "nakagami/reportlab",
"path": "tests/test_encrypt.py",
"copies": "1",
"size": "2209",
"license": "bsd-3-clause",
"hash": -8818998605682397000,
"line_mean": 36.4406779661,
"line_max": 96,
"alpha_frac": 0.6966953373,
"autogenerated": false,
"ratio": 4.00907441016334,
"config_test": ... |
__version__='''$Id: test_images.py 3959 2012-09-27 14:39:39Z robin $'''
__doc__="""Tests to do with image handling.
Most of them make use of test\pythonpowereed.gif."""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
setOutDir(__name__)
import os
try:
from hashlib import md5
except... | {
"repo_name": "nakagami/reportlab",
"path": "tests/test_images.py",
"copies": "1",
"size": "2217",
"license": "bsd-3-clause",
"hash": 326343055850942460,
"line_mean": 42.4705882353,
"line_max": 374,
"alpha_frac": 0.7135769057,
"autogenerated": false,
"ratio": 2.4798657718120807,
"config_test": ... |
__version__=''' $Id: test_platypus_tables.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__='Test script for reportlab.tables'
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import os,unittest
from reportlab.platypus import Spacer, SimpleDocTemplate, Tabl... | {
"repo_name": "nakagami/reportlab",
"path": "tests/test_platypus_tables.py",
"copies": "1",
"size": "37593",
"license": "bsd-3-clause",
"hash": 8127846127267805000,
"line_mean": 42.9684210526,
"line_max": 216,
"alpha_frac": 0.519618014,
"autogenerated": false,
"ratio": 3.1120033112582783,
"conf... |
__version__='3.3.0'
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'mappings' between the font family name and the rig... | {
"repo_name": "aragos/tichu-tournament",
"path": "python/reportlab/lib/fonts.py",
"copies": "3",
"size": "3531",
"license": "mit",
"hash": -1439484962574299100,
"line_mean": 35.4020618557,
"line_max": 101,
"alpha_frac": 0.5576323988,
"autogenerated": false,
"ratio": 3.1925858951175408,
"config_... |
__all__=('Formatter','DecimalFormatter')
__version__='3.3.0'
__doc__="""
These help format numbers and dates in a user friendly way.
Used by the graphics framework.
"""
import string, sys, os, re
class Formatter:
"Base formatter - simply applies python format strings"
def __init__(self, pattern):
self.... | {
"repo_name": "Ashaba/rms",
"path": "rmslocalenv/lib/python2.7/site-packages/reportlab/lib/formatters.py",
"copies": "3",
"size": "3834",
"license": "mit",
"hash": 921624942150877700,
"line_mean": 34.1743119266,
"line_max": 160,
"alpha_frac": 0.5427751695,
"autogenerated": false,
"ratio": 3.43548... |
__version__='3.3.0'
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
'''
def __init__(self):
self._fps... | {
"repo_name": "Ashaba/rms",
"path": "rmslocalenv/lib/python2.7/site-packages/reportlab/lib/logger.py",
"copies": "3",
"size": "1760",
"license": "mit",
"hash": -291119522166049200,
"line_mean": 27.8524590164,
"line_max": 102,
"alpha_frac": 0.5846590909,
"autogenerated": false,
"ratio": 3.59183673... |
__version__='3.3.0'
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'mappings' between the font family name and the rig... | {
"repo_name": "ryfeus/lambda-packs",
"path": "Pdf_docx_pptx_xlsx_epub_png/source/reportlab/lib/fonts.py",
"copies": "2",
"size": "3531",
"license": "mit",
"hash": 6194463131525257000,
"line_mean": 35.4020618557,
"line_max": 101,
"alpha_frac": 0.5576323988,
"autogenerated": false,
"ratio": 3.19258... |
__all__=('Formatter','DecimalFormatter')
__version__='3.3.0'
__doc__="""
These help format numbers and dates in a user friendly way.
Used by the graphics framework.
"""
import string, sys, os, re
class Formatter:
"Base formatter - simply applies python format strings"
def __init__(self, pattern):
self.... | {
"repo_name": "sandeepkoduri/GAE-html-to-pdf",
"path": "libs/reportlab/lib/formatters.py",
"copies": "2",
"size": "3834",
"license": "mit",
"hash": -2712662049117786600,
"line_mean": 34.1743119266,
"line_max": 160,
"alpha_frac": 0.5427751695,
"autogenerated": false,
"ratio": 3.435483870967742,
... |
__version__='3.3.0'
__doc__="Logging and warning framework, predating Python's logging package"
from sys import stderr
class Logger:
'''
An extended file type thing initially equivalent to sys.stderr
You can add/remove file type things; it has a write method
'''
def __init__(self):
self._fps... | {
"repo_name": "sandeepkoduri/GAE-html-to-pdf",
"path": "libs/reportlab/lib/logger.py",
"copies": "2",
"size": "1760",
"license": "mit",
"hash": -4121673180521738000,
"line_mean": 27.8524590164,
"line_max": 102,
"alpha_frac": 0.5846590909,
"autogenerated": false,
"ratio": 3.5918367346938775,
"co... |
"""This module defines a few common page sizes in points (1/72 inch).
To be expanded to include things like label sizes, envelope windows
etc."""
__version__='3.3.0'
from reportlab.lib.units import cm, inch
_W, _H = (21*cm, 29.7*cm)
A6 = (_W*.5, _H*.5)
A5 = (_H*.5, _W)
A4 = (_W, _H)
A3 = (_H, _W*2)
A2 = (_W*2, _H*2... | {
"repo_name": "sandeepkoduri/GAE-html-to-pdf",
"path": "libs/reportlab/lib/pagesizes.py",
"copies": "2",
"size": "1511",
"license": "mit",
"hash": 6832326568453344000,
"line_mean": 22.625,
"line_max": 105,
"alpha_frac": 0.6141628061,
"autogenerated": false,
"ratio": 2.33179012345679,
"config_te... |
#! /bin/env python
'''create a script to feed to the redis-cli to delete cached
harvested images information'''
import sys
import os
from harvester.post_processing.couchdb_runner import get_collection_doc_ids
redis_hash_key = 'ucldc:harvester:harvested-images'
def create_redis_deletion_script(url_remote_couchdb, col... | {
"repo_name": "ucldc/harvester",
"path": "scripts/redis_delete_harvested_images_script.py",
"copies": "3",
"size": "1625",
"license": "bsd-3-clause",
"hash": -5612150382640164000,
"line_mean": 36.7906976744,
"line_max": 78,
"alpha_frac": 0.6806153846,
"autogenerated": false,
"ratio": 3.3574380165... |
#! /bin/env python
'''Creates a sub-matrix from selected columns of a csv file.
The cvs file can be passed to stdin'''
from PEATSA import Core
import sys, optparse
usage = "usage: %prog [options]"
parser = optparse.OptionParser(usage=usage, version="% 0.1", description=__doc__)
parser.add_option("-f", "--file", dest... | {
"repo_name": "dmnfarrell/peat",
"path": "PEATSA/Tools/ExtractColumns.py",
"copies": "1",
"size": "1211",
"license": "mit",
"hash": 2614488405575578000,
"line_mean": 29.275,
"line_max": 81,
"alpha_frac": 0.6597853014,
"autogenerated": false,
"ratio": 3.272972972972973,
"config_test": false,
"... |
#!/bin/env python
"""Decrypts file if it matches syntax"""
import os
import re
import shlex
import urllib
from subprocess import Popen, PIPE, check_output
try:
check_output(["gpg", "-h"])
ENCRYPTION_DISABLED = False
except FileNotFoundError:
ENCRYPTION_DISABLED = True
def decrypt_files(file_link):
"""
... | {
"repo_name": "lich/limf",
"path": "limf/decrypter.py",
"copies": "2",
"size": "1686",
"license": "mit",
"hash": 4726630405796016000,
"line_mean": 35.652173913,
"line_max": 91,
"alpha_frac": 0.5996441281,
"autogenerated": false,
"ratio": 3.673202614379085,
"config_test": false,
"has_no_keywor... |
#!/bin/env python
def func3():
print "world.py func3"
class MyClass:
def __init__(self,arg1, arg2, arg3):
print "MyClass __init__"
self.arg1 = arg1
self.arg2 = arg2
self.arg3 = arg3
def hello(self):
print "hello"
print " %s %s %s" %(self.arg1, self.arg2, s... | {
"repo_name": "patrebert/pynet_cert",
"path": "class9/ex6/world.py",
"copies": "1",
"size": "1085",
"license": "apache-2.0",
"hash": -5302836858959148000,
"line_mean": 22.5869565217,
"line_max": 78,
"alpha_frac": 0.5539170507,
"autogenerated": false,
"ratio": 2.9010695187165774,
"config_test": ... |
#!/bin/env python
"""devclean
Usage:
devclean <rootpath> [--show]
devclean (-h | --help)
devclean --version
Options:
-h --help Show this screen.
--version Show version.
--show Only show dont kill files
"""
import os, sys
from fnmatch import fnmatch
from docopt import docopt
crap_matcher... | {
"repo_name": "mikadosoftware/weaver",
"path": "weaver/devtools/devclean.py",
"copies": "1",
"size": "1535",
"license": "mit",
"hash": -2953660942299672600,
"line_mean": 21.2463768116,
"line_max": 62,
"alpha_frac": 0.5237785016,
"autogenerated": false,
"ratio": 3.528735632183908,
"config_test":... |
#!/bin/env python
__docform__ = "restructuredtext" #for epydoc
import sys
import os
import re
from datetime import datetime
from copy import copy, deepcopy
import urllib2
try:
import pyfits
except:
pass # isolating astronomy specific code
import numpy
import astrodata
from AstroDataType import *
import Descri... | {
"repo_name": "pyrrho314/recipesystem",
"path": "trunk/astrodata/AstroData.py",
"copies": "1",
"size": "109601",
"license": "mpl-2.0",
"hash": -2642339109582447000,
"line_mean": 41.746099844,
"line_max": 192,
"alpha_frac": 0.5570387132,
"autogenerated": false,
"ratio": 4.2664564599634085,
"conf... |
#!/bin/env/python
"""Duplicated Django South migrations locator.
"""
import argparse
import subprocess
import re
import sys
def get_kev_value(line):
"""Extract key and value from the migration path.
"""
key = '/'.join(line.split('/')[:-1])
value = line.split('/')[-1:][0]
return (key, value)
REGEX... | {
"repo_name": "opportunitynetwork/on-tools",
"path": "src/scripts/check_migrations.py",
"copies": "1",
"size": "2563",
"license": "bsd-3-clause",
"hash": -1994370164878049300,
"line_mean": 32.2857142857,
"line_max": 92,
"alpha_frac": 0.5957861881,
"autogenerated": false,
"ratio": 4.05537974683544... |
#!/bin/env/python
# -*- encoding -*-
"""
===============================================================================
Grond Station Gimbal
===============================================================================
author=hal112358
-------------------------------------------------------------------------------
"... | {
"repo_name": "hal112358/clark_aerospace",
"path": "ground_station/gimbal.py",
"copies": "1",
"size": "1340",
"license": "mit",
"hash": 7259750711217676000,
"line_mean": 22.9285714286,
"line_max": 79,
"alpha_frac": 0.3798507463,
"autogenerated": false,
"ratio": 4.085365853658536,
"config_test":... |
def scatter(plt, points, format='b'):
plt.scatter(map(lambda x:x[0], points), map(lambda x:x[1], points), c=format)
def distribution_bar(plt, data, begin, step, end, x_gap=1, format='b', label='Distribution'):
import pyda
dist = pyda.bucket_distribution(data, begin, step, end)
ticks = map(lambda ... | {
"repo_name": "nickgu/pydev",
"path": "easy_plot.py",
"copies": "1",
"size": "1875",
"license": "mit",
"hash": -2553793430728948700,
"line_mean": 28.7619047619,
"line_max": 93,
"alpha_frac": 0.5824,
"autogenerated": false,
"ratio": 2.741228070175439,
"config_test": false,
"has_no_keywords": f... |
import os
import logging
import traceback
import sys
import pydev
def beta_range(disp, click, prob=0.95):
from scipy.stats import beta
return beta_bound(disp, click, (1-prob)*0.5), beta_bound(disp, click, prob+(1-prob)*0.5)
def beta_bound(disp, click, prob=0.05):
from scipy.stats import beta
return b... | {
"repo_name": "nickgu/pydev",
"path": "pyda.py",
"copies": "1",
"size": "8122",
"license": "mit",
"hash": -3527165928463911400,
"line_mean": 30,
"line_max": 107,
"alpha_frac": 0.5152671756,
"autogenerated": false,
"ratio": 3.3300533005330055,
"config_test": false,
"has_no_keywords": false,
... |
#!/bin/env python
#encoding:utf-8
from dbutils import MYSQLConnection
class Asset(object):
def __init__(self,**kwargs):
self.id=id
self.sn=sn
self.iner_ip=iner_ip
self.hostname=hostname
self.cpu=cpu
@classmethod
def get_list(cls,wheres={}):
_colum='id,sn,ine... | {
"repo_name": "51reboot/actual_09_homework",
"path": "11/zhouyang/cmdb/user/assets_class.py",
"copies": "1",
"size": "5740",
"license": "mit",
"hash": -1851992785596634000,
"line_mean": 35.1241830065,
"line_max": 348,
"alpha_frac": 0.5595367354,
"autogenerated": false,
"ratio": 2.9535008017103155... |
#!/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import json
import requests
url = "http://127.0.0.1:2000/api"
#登录并获取token
def login(username,password):
rep_url = "%s/login?username=%s&passwd=%s" % (url,username,password)
r = requests.get(rep_url)
result... | {
"repo_name": "liu-jian/seos1.0",
"path": "test/user_test.py",
"copies": "1",
"size": "3168",
"license": "apache-2.0",
"hash": -6509547989225039000,
"line_mean": 26.1826086957,
"line_max": 90,
"alpha_frac": 0.3563659629,
"autogenerated": false,
"ratio": 4.241519674355495,
"config_test": false,
... |
#!/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import json
import requests
url = "http://127.0.0.1:3000/api"
#登录并获取token
def login(username,password):
rep_url = "%s/login?username=%s&passwd=%s" % (url,username,password)
r = requests.get(rep_url)
result... | {
"repo_name": "liu-jian/seos1.0",
"path": "test/server_test.py",
"copies": "1",
"size": "2621",
"license": "apache-2.0",
"hash": -4119765507768123400,
"line_mean": 24.3039215686,
"line_max": 80,
"alpha_frac": 0.3525765207,
"autogenerated": false,
"ratio": 4.0968253968253965,
"config_test": fals... |
#!/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import json
import requests
url = "http://127.0.0.1:4000/api"
#登录并获取token
def login(username,password):
rep_url = "%s/login?username=%s&passwd=%s" % (url,username,password)
r = requests.get(rep_url)
result... | {
"repo_name": "liu-jian/seos1.0",
"path": "test/power_test.py",
"copies": "1",
"size": "2572",
"license": "apache-2.0",
"hash": -7507042305574424000,
"line_mean": 25.6736842105,
"line_max": 80,
"alpha_frac": 0.364640884,
"autogenerated": false,
"ratio": 4.209302325581396,
"config_test": false,
... |
#!/bin/env python
#encoding:utf-8
from multiprocessing import Pool
from bs4 import BeautifulSoup
import os, time
import requests
def get_Data(url):
start = time.time()
page = requests.get(url).text
soup = BeautifulSoup(page, "html.parser")
title = soup.find_all('div', class_='report-title')[0]("h1")[0]... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_old/test_multiprocessing.py",
"copies": "1",
"size": "4987",
"license": "mit",
"hash": 1685891303907622400,
"line_mean": 58.369047619,
"line_max": 83,
"alpha_frac": 0.7260878284,
"autogenerated": false,
"ratio": 2.74010989010989,
"c... |
#!/bin/env python
#encoding:utf-8
from multiprocessing import Pool
from bs4 import BeautifulSoup
import time
import requests
def get_Data(url):
start = time.time()
page = requests.get(url).text
#soup = BeautifulSoup(page, from_encoding='gb2312')
soup = BeautifulSoup(page, 'html.parser')
title = sou... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_old/test_singleprocessing.py",
"copies": "1",
"size": "4893",
"license": "mit",
"hash": 8071030842820053000,
"line_mean": 60.9367088608,
"line_max": 83,
"alpha_frac": 0.7287962395,
"autogenerated": false,
"ratio": 2.73046875,
"confi... |
#!/bin/env python
#encoding:utf-8
from pymongo import MongoClient
import datetime
# Settings
mongopath = "localhost" # 数据库地址
startDate = "20150104" # 检索数据开始日期
endDate = "20150529" # 检索数据结束日期
#endDate = "20150227" # 检索数据结束日期
nowDate = datetime.datetime.now().strftime("%Y%m%d") # 当前日期
# Functions
def isNotWorkD... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_new/statistics/sta.py",
"copies": "1",
"size": "4999",
"license": "mit",
"hash": 116269435767222690,
"line_mean": 23.6345177665,
"line_max": 116,
"alpha_frac": 0.5079332372,
"autogenerated": false,
"ratio": 3.0199128811449905,
"conf... |
#!/bin/env python
#encoding:utf-8
from pymongo import MongoClient
import sys
import datetime
# Settings
mongopath = "localhost" # 数据库地址
startDate = "20150104" # 检索数据开始日期
endDate = "20150529" # 检索数据结束日期
#endDate = "20150227" # 检索数据结束日期(三个月预留)
nowDate = datetime.datetime.now().strftime("%Y%m%d") # 当前日期
startDate... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "sina_guping/statistics-6/sta-2.py",
"copies": "1",
"size": "2403",
"license": "mit",
"hash": 8261815234288486000,
"line_mean": 19.1327433628,
"line_max": 88,
"alpha_frac": 0.5758241758,
"autogenerated": false,
"ratio": 3.0619111709286675,
... |
#!/bin/env python
#encoding:utf-8
from selenium import webdriver
from bs4 import BeautifulSoup
import time
import re
import json
import base64
# -----------------------------------------------------------------
# 这个程序可以爬取http://data.eastmoney.com/report/ 网站的股评数据
# ------------------------------------------------------... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_old/run-simple.py",
"copies": "1",
"size": "2095",
"license": "mit",
"hash": 1258931965195104300,
"line_mean": 19.8617021277,
"line_max": 120,
"alpha_frac": 0.5119836818,
"autogenerated": false,
"ratio": 2.9051851851851853,
"config_... |
#!/bin/env python
#encoding:utf-8
from selenium import webdriver
from pymongo import MongoClient
from bs4 import BeautifulSoup
import time
import re
import json
import base64
import urllib2
import requests
# -----------------------------------------------------------------
# This tools can get info from 'http://data.e... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_old/run-2.py",
"copies": "1",
"size": "3727",
"license": "mit",
"hash": -5137852087924936000,
"line_mean": 26.8134328358,
"line_max": 120,
"alpha_frac": 0.5309900724,
"autogenerated": false,
"ratio": 3.460538532961931,
"config_test"... |
#!/bin/env python
#encoding:utf-8
from selenium import webdriver
from pymongo import MongoClient
from bs4 import BeautifulSoup
import time
import re
import json
import base64
# -----------------------------------------------------------------
# 这个程序可以爬取http://data.eastmoney.com/report/ 网站的股评数据
# ----------------------... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_old/run.py",
"copies": "1",
"size": "2361",
"license": "mit",
"hash": 317193183562079800,
"line_mean": 20.4134615385,
"line_max": 120,
"alpha_frac": 0.5154916929,
"autogenerated": false,
"ratio": 2.965379494007989,
"config_test": fa... |
#! /bin/env python
# encoding=utf-8
# gusimiu@baidu.com
# datemark: 20150428
#
# V1.9:
# Add AutoArg for smart arg parsing.
#
# V1.8:
# Add tuple transformer to parse tuple by string format.
# foreach_row support string format.
#
# V1.7:
# Add color string
# Add App.
#
# V1.6... | {
"repo_name": "nickgu/pydev",
"path": "pydev.py",
"copies": "1",
"size": "46084",
"license": "mit",
"hash": -7689760132631411000,
"line_mean": 29.0521852577,
"line_max": 137,
"alpha_frac": 0.4966138485,
"autogenerated": false,
"ratio": 3.6099357467481585,
"config_test": true,
"has_no_keywords... |
#! /bin/env python
# encoding=utf-8
# gusimiu@baidu.com
#
"""notes
"""
import time
import sys
import os
import c_kvdict2
import logging
class KVDict(object):
"""notes
"""
def __init__(self):
"""notes
"""
self.__dict_handle = c_kvdict2.create()
logging.info('GET C_KVDICT : ... | {
"repo_name": "nickgu/kvdict2",
"path": "script/kvdict2.py",
"copies": "1",
"size": "6663",
"license": "mit",
"hash": 8742565911126912000,
"line_mean": 24.6269230769,
"line_max": 80,
"alpha_frac": 0.5032267747,
"autogenerated": false,
"ratio": 3.4327666151468317,
"config_test": false,
"has_no... |
#! /bin/env python
# encoding=utf-8
# gusimiu@baidu.com
#
# 对kvdict进行性能测试
#
import os
import sys
import time
import random
import kvdict2
def random_string(n):
ret = ('%1d' % random.randint(0, 10)) * n
return ret
def test_file(d):
d.load(file_name)
tm_begin = time.time()
for k in key_list:
... | {
"repo_name": "nickgu/kvdict2",
"path": "script/benchmark.py",
"copies": "1",
"size": "1661",
"license": "mit",
"hash": -5733931140852214000,
"line_mean": 26,
"line_max": 79,
"alpha_frac": 0.5689131755,
"autogenerated": false,
"ratio": 2.810580204778157,
"config_test": true,
"has_no_keywords"... |
#!/bin/env python
# encoding: utf8
import datetime, logging
import imaplib, smtplib
import time, base64
from email.parser import Parser
from email.message import EmailMessage
from email.utils import make_msgid
logging.basicConfig(
level=logging.INFO,
filename='mail.log',
format='%(asctime)s %(levelname)s ... | {
"repo_name": "dlutxx/memo",
"path": "python/mail-forward.py",
"copies": "1",
"size": "7103",
"license": "mit",
"hash": -8793542273779941000,
"line_mean": 32.0512820513,
"line_max": 95,
"alpha_frac": 0.5498836307,
"autogenerated": false,
"ratio": 2.787629757785467,
"config_test": false,
"has_... |
#!/bin/env python
#encoding:utf-8
import re
import json
#import pymongo
from pymongo import MongoClient
from bs4 import BeautifulSoup
# read file
f = open('index.html', 'r')
html = f.read()
#print html
# re
#pattern = re.compile(r'firstInit\(([\s\S]+)\);'?)
#pattern = re.compile(r'firstInit\(([\s\S]+?)\);')
pattern =... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_old/test.py",
"copies": "1",
"size": "1254",
"license": "mit",
"hash": 3608794399594144000,
"line_mean": 20.6206896552,
"line_max": 50,
"alpha_frac": 0.5390749601,
"autogenerated": false,
"ratio": 2.9299065420560746,
"config_test": ... |
#!/bin/env python
#encoding=utf-8
import re
import lxml
import lxml.html
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from .tags_util import clean_tags_only, clean_tags_hasprop, clean_tags_exactly, clean_tags, pick_listed_tags, clean_ainp_tags
from .region import Regi... | {
"repo_name": "fxsjy/jparser",
"path": "jparser/model.py",
"copies": "1",
"size": "5662",
"license": "mit",
"hash": 1599858968072885000,
"line_mean": 40.6323529412,
"line_max": 125,
"alpha_frac": 0.4864005652,
"autogenerated": false,
"ratio": 3.8940852819807428,
"config_test": false,
"has_no_... |
#!/bin/env python
#encoding:utf-8
import re
import time
import base64
from bs4 import BeautifulSoup
from selenium import webdriver
from pymongo import MongoClient
from multiprocessing import Pool
# Settings
PAGE_NUMBER = 283
BASE_URL = "http://data.eastmoney.com/report/#"
ALL_PARAMS = 'tp=1&cg=0&dt=2&page='
# Set Sing... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "guping_new/getEastmoneyReport/main.py",
"copies": "1",
"size": "3557",
"license": "mit",
"hash": 7135806652922043000,
"line_mean": 25.1544117647,
"line_max": 94,
"alpha_frac": 0.551869553,
"autogenerated": false,
"ratio": 3.290471785383904,
... |
#!/bin/env python
#encoding:utf-8
import requests
from bs4 import BeautifulSoup
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.guping
def getDict():
content = requests.get("http://quote.eastmoney.com/stocklist.html").content
#print content
soup = BeautifulSoup(conte... | {
"repo_name": "sincerefly/getEastmoneyReport",
"path": "sina_guping/tools/addCodeName.py",
"copies": "1",
"size": "1333",
"license": "mit",
"hash": -9183551471067048000,
"line_mean": 15.8734177215,
"line_max": 114,
"alpha_frac": 0.5603900975,
"autogenerated": false,
"ratio": 3.652054794520548,
... |
from CodernityDB.database import Database
from CodernityDB.tree_index import TreeBasedIndex
import sys
class WithXIndex(TreeBasedIndex):
def __init__(self, *args, **kwargs):
kwargs['node_capacity'] = 10
kwargs['key_format'] = 'I'
super(WithXIndex, self).__init__(*args, **kwargs)
def... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/analysis_opensnp/dbtest.py",
"copies": "1",
"size": "1669",
"license": "apache-2.0",
"hash": -3954297481640485400,
"line_mean": 23.1884057971,
"line_max": 75,
"alpha_frac": 0.5014979029,
"autogenerated": false,
"ratio": 3.1730... |
import sys
from collections import Counter
arg = sys.argv[1]
chrList = ["chrX"]
index = [
"GBR",
"FIN",
"CHS",
"PUR",
"CLM",
"IBS",
"CEU",
"YRI",
"CHB",
"JPT",
"LWK",
"ASW",
"MXL",
"TSI"
]
conDi... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/analysis_opensnp/get_pop.py",
"copies": "1",
"size": "4499",
"license": "apache-2.0",
"hash": 7985004950183378000,
"line_mean": 30.4615384615,
"line_max": 91,
"alpha_frac": 0.3869748833,
"autogenerated": false,
"ratio": 3.5369... |
import os, sys, time
def initialize():
chrList = ["chrX"]
for i in range(1,23):
chrList.append("chr" + str(i))
openList = []
openFile = open("opensnp_id.lst", "r")
lines = openFile.readlines()
for line in lines:
openList.append(line.rstrip("\r\n"))
openFile.close()
pr... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/analysis_opensnp/openid_freq.py",
"copies": "1",
"size": "1968",
"license": "apache-2.0",
"hash": 6631293208708127000,
"line_mean": 27.9411764706,
"line_max": 71,
"alpha_frac": 0.5116869919,
"autogenerated": false,
"ratio": 3.... |
import sys, commands
arg = sys.argv[1]
ls = commands.getoutput("ls " + arg)
lst = [item for item in ls.split("\n")]
idList = []
print "start [[1]]"
for i in range(len(lst)):
infile = open(arg + "/" + lst[i], "r")
lines = infile.readlines()
infile.close()
count = 1
if "23andme" in lst[i] and "2... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/analysis_opensnp/osp_set.py",
"copies": "1",
"size": "1411",
"license": "apache-2.0",
"hash": 2718628454439652400,
"line_mean": 22.5166666667,
"line_max": 86,
"alpha_frac": 0.5230333097,
"autogenerated": false,
"ratio": 3.0607... |
from mysql.connector import *
import sys, os
import copy
infile = open('../annotations/23andme_gene.lst', "r")
idList = ["rs"+r.rstrip("\r\n") for r in infile.readlines()]
infile.close()
cnt = connect(user='root', password='pass', database='samples', charset='utf8')
cus = cnt.cursor(buffered=True)
chrList = ["chrX"... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/OLD/mysql_ilm.py",
"copies": "1",
"size": "1161",
"license": "apache-2.0",
"hash": 4887470244050522000,
"line_mean": 24.8,
"line_max": 79,
"alpha_frac": 0.5099052541,
"autogenerated": false,
"ratio": 3.345821325648415,
"conf... |
import sys, re
from collections import OrderedDict
outFile = open("userinfo.csv", "w")
for i in range(1,2601):
try:
infile = open("html/user" + str(i) + ".html", "r")
lines = infile.readlines()
infile.close()
links = {}
ptypes = []
for n in range(1, 297):
... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/analysis_opensnp/edit_html.py",
"copies": "1",
"size": "3111",
"license": "apache-2.0",
"hash": 5252033383667426000,
"line_mean": 33.9550561798,
"line_max": 73,
"alpha_frac": 0.3841208615,
"autogenerated": false,
"ratio": 3.85... |
from pymongo import Connection
con = Connection('localhost')
coll = con["opensnp"]["info"]
infile = open("phenotype.csv", "r")
lines = infile.readlines()
infile.close()
pDict = {}
for line in lines:
tmp = line.split("*,*")
pDict[int(tmp[0])] = tmp[1].rstrip("\r\n")
infile = open("achivements.csv", "r")
lin... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/analysis_opensnp/create_hdr.py",
"copies": "1",
"size": "1341",
"license": "apache-2.0",
"hash": -1586440917359826000,
"line_mean": 21.35,
"line_max": 105,
"alpha_frac": 0.5525727069,
"autogenerated": false,
"ratio": 2.9025974... |
"""
from mysql.connector import *
cnt = connect(user='root', password='pass', database='samples', charset='utf8')
cus = cnt.cursor(buffered=True)
chrList = ["chrX"]
for i in range(1,23):
chrList.append("chr" + str(i))
"""
idList = {
"rs1801282": "C",
"rs3856806": "C",
"rs5219": "A",
... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/OLD/check_diabetes.py",
"copies": "1",
"size": "1800",
"license": "apache-2.0",
"hash": 5043012708565133000,
"line_mean": 22.3766233766,
"line_max": 79,
"alpha_frac": 0.4411111111,
"autogenerated": false,
"ratio": 3.1802120141... |
infile = open("ilm_missene.onmis.vcf", "r")
lines = infile.readlines()
infile.close()
msDict = {}
for line in lines:
samples = line.split(",")[5]
tmp = samples.split("|")
for i in range(len(tmp)):
try:
msDict[i][int(tmp[i])] += 1
except:
msDict[i] = [0, 0, 0, 0]
... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/add_annotations/missene_value.py",
"copies": "1",
"size": "1098",
"license": "apache-2.0",
"hash": 5032802179952098000,
"line_mean": 22.3617021277,
"line_max": 45,
"alpha_frac": 0.5154826958,
"autogenerated": false,
"ratio": 2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.