text stringlengths 0 1.05M | meta dict |
|---|---|
# $Id: CacheRegion.py,v 1.1 2006-09-06 09:50:08 skyostil Exp $
"""Cache holder classes for Cheetah:
Cache regions are defined using the #cache Cheetah directive. Each
cache region can be viewed as a dictionary (keyed by cacheRegionID)
handling at least one cache item (the default one). It's possible to add
cache... | {
"repo_name": "skyostil/tracy",
"path": "src/generator/Cheetah/CacheRegion.py",
"copies": "1",
"size": "4911",
"license": "mit",
"hash": 3986817323145864700,
"line_mean": 33.5869565217,
"line_max": 89,
"alpha_frac": 0.6281816331,
"autogenerated": false,
"ratio": 3.982968369829684,
"config_test"... |
# $Id: CacheRegion.py,v 1.3 2006/01/28 04:19:30 tavis_rudd Exp $
'''
Cache holder classes for Cheetah:
Cache regions are defined using the #cache Cheetah directive. Each
cache region can be viewed as a dictionary (keyed by cacheRegionID)
handling at least one cache item (the default one). It's possible to add
cacheIte... | {
"repo_name": "nzavagli/UnrealPy",
"path": "UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Cheetah-2.4.4/cheetah/CacheRegion.py",
"copies": "15",
"size": "4421",
"license": "mit",
"hash": 8394706611386328000,
"line_mean": 31.5073529412,
"line_max": 80,
"alpha... |
import sys
from rdkit import six
if not six.PY3:
bytes = buffer
# for Python3, import cairocffi preferably
if six.PY3:
try:
import cairocffi as cairo
except ImportError:
import cairo
else:
try:
import cairo
except ImportError:
import cairocffi as cairo
if not hasattr(cairo.ImageSurface,'get... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/Chem/Draw/cairoCanvas.py",
"copies": "1",
"size": "10317",
"license": "bsd-3-clause",
"hash": 7659760274741207000,
"line_mean": 31.4433962264,
"line_max": 98,
"alpha_frac": 0.5960065911,
"autogenerated": false,
"ratio": 3.029955947136564,
"config_tes... |
import sys
try:
import cairo
except ImportError:
import cairocffi as cairo
if not hasattr(cairo.ImageSurface,'get_data') and \
not hasattr(cairo.ImageSurface,'get_data_as_rgba'):
raise ImportError('cairo version too old')
import math
import rdkit.RDConfig
import os,re
import array
if not 'RDK_NOPANGO' in os.... | {
"repo_name": "AlexanderSavelyev/rdkit",
"path": "rdkit/Chem/Draw/cairoCanvas.py",
"copies": "1",
"size": "9751",
"license": "bsd-3-clause",
"hash": 2428390536177379000,
"line_mean": 30.5566343042,
"line_max": 91,
"alpha_frac": 0.6077325403,
"autogenerated": false,
"ratio": 3.005856966707768,
"... |
"""$Id: category.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from... | {
"repo_name": "petecummings/NewsBlur",
"path": "vendor/feedvalidator/category.py",
"copies": "16",
"size": "1079",
"license": "mit",
"hash": -8707983106216220000,
"line_mean": 34.9666666667,
"line_max": 97,
"alpha_frac": 0.6682113068,
"autogenerated": false,
"ratio": 3.127536231884058,
"config_... |
# $Id: cdp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Cisco Discovery Protocol."""
from __future__ import absolute_import
import struct
from . import dpkt
CDP_DEVID = 1 # string
CDP_ADDRESS = 2
CDP_PORTID = 3 # string
CDP_CAPABILITIES = 4 # 32-bit bitmask
CDP_VERSION = 5 # string
CDP_PLATFOR... | {
"repo_name": "dimagol/trex-core",
"path": "scripts/external_libs/dpkt-1.9.1/dpkt/cdp.py",
"copies": "3",
"size": "3053",
"license": "apache-2.0",
"hash": -4306279695577335300,
"line_mean": 26.5045045045,
"line_max": 60,
"alpha_frac": 0.4854241729,
"autogenerated": false,
"ratio": 3.2757510729613... |
# $Id: cdp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Cisco Discovery Protocol."""
import struct
import dpkt
CDP_DEVID = 1 # string
CDP_ADDRESS = 2
CDP_PORTID = 3 # string
CDP_CAPABILITIES = 4 # 32-bit bitmask
CDP_VERSION = 5 # string
CDP_PLATFORM = 6 # string
CDP_IPPREFIX = 7
CDP_VTP_MGMT_... | {
"repo_name": "lkash/test",
"path": "dpkt/cdp.py",
"copies": "6",
"size": "2792",
"license": "bsd-3-clause",
"hash": -1523198895272958000,
"line_mean": 27.202020202,
"line_max": 60,
"alpha_frac": 0.4717048711,
"autogenerated": false,
"ratio": 3.216589861751152,
"config_test": false,
"has_no_k... |
# $Id: cdp.py 23 2006-11-08 15:45:33Z dugsong $
"""Cisco Discovery Protocol."""
import struct
import dpkt
CDP_DEVID = 1 # string
CDP_ADDRESS = 2
CDP_PORTID = 3 # string
CDP_CAPABILITIES = 4 # 32-bit bitmask
CDP_VERSION = 5 # string
CDP_PLATFORM = 6 # string
CDP_IPPREFIX = 7
CDP_VTP_MGMT_DOMAIN = 9 # string
C... | {
"repo_name": "jacklee0810/QMarkdowner",
"path": "dpkt/cdp.py",
"copies": "15",
"size": "2792",
"license": "mit",
"hash": -1342541471977565400,
"line_mean": 28.3894736842,
"line_max": 60,
"alpha_frac": 0.4681232092,
"autogenerated": false,
"ratio": 3.140607424071991,
"config_test": false,
"ha... |
# $Id: cee003fb7c38cb61af6bf2d036245576cfc8cf44 $
"""
File Locking
============
This module provides portable advisory file locking primitives that operate on
file descriptors. POSIX-like systems and Windows systems use different
primitives to perform file locking, and these different primitives are modeled
by incomp... | {
"repo_name": "undoware/neutron-drive",
"path": "google_appengine/lib/grizzled/grizzled/io/filelock.py",
"copies": "19",
"size": "5831",
"license": "bsd-3-clause",
"hash": 3702866897867850000,
"line_mean": 27.8663366337,
"line_max": 79,
"alpha_frac": 0.5374721317,
"autogenerated": false,
"ratio":... |
# $Id: CGITemplate.py,v 1.6 2006/01/29 02:09:59 tavis_rudd Exp $
"""A subclass of Cheetah.Template for use in CGI scripts.
Usage in a template:
#extends Cheetah.Tools.CGITemplate
#implements respond
$cgiHeaders#slurp
Usage in a template inheriting a Python class:
1. The template
#extends MyPythonClass... | {
"repo_name": "dragondjf/QMarkdowner",
"path": "Cheetah/Tools/CGITemplate.py",
"copies": "15",
"size": "2200",
"license": "mit",
"hash": 7283538975584913000,
"line_mean": 27.5714285714,
"line_max": 80,
"alpha_frac": 0.6518181818,
"autogenerated": false,
"ratio": 3.6303630363036303,
"config_test... |
"""$Id: channel.py 711 2006-10-25 00:43:41Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 711 $"
__date__ = "$Date: 2006-10-25 00:43:41 +0000 (Wed, 25 Oct 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from ... | {
"repo_name": "dosiecki/NewsBlur",
"path": "vendor/feedvalidator/channel.py",
"copies": "16",
"size": "9663",
"license": "mit",
"hash": 1205504065043989500,
"line_mean": 33.6344086022,
"line_max": 110,
"alpha_frac": 0.6672875918,
"autogenerated": false,
"ratio": 3.4696588868940754,
"config_test... |
""" Provide a remote control console via SSH. """
from peloton.plugins import PelotonPlugin
from peloton.coreio import PelotonManagementInterface
from peloton.exceptions import PluginError
from twisted.application import service, strports
from twisted.cred import checkers, portal
from twisted.conch import manhole, ma... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/plugins/cockpit.py",
"copies": "1",
"size": "6901",
"license": "bsd-3-clause",
"hash": 6873082628401717000,
"line_mean": 35.7127659574,
"line_max": 84,
"alpha_frac": 0.6204897841,
"autogenerated": false,
"ratio": 3.94568324757004,
"config_t... |
# $Id: Combinators.py 1047 2009-01-15 14:48:58Z graham $
#
"""
Combinators for use with Python code, mostly based on Haskell library elements.
(Also contains some other Haskell-style list/tuple functions functions.)
Strictly speaking, the "curry..." functions are not currying, but partial
application. Currying is th... | {
"repo_name": "wf4ever/ro-manager",
"path": "src/MiscUtils/Combinators.py",
"copies": "1",
"size": "1973",
"license": "mit",
"hash": -5322592649579358000,
"line_mean": 31.3442622951,
"line_max": 80,
"alpha_frac": 0.6573745565,
"autogenerated": false,
"ratio": 3.384219554030875,
"config_test": f... |
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted, provided that the above copyright notice, the follo... | {
"repo_name": "fresskarma/tinyos-1.x",
"path": "contrib/nestfe/python/pytos/Comm.py",
"copies": "2",
"size": "3828",
"license": "bsd-3-clause",
"hash": 2943902533733374000,
"line_mean": 31.1680672269,
"line_max": 123,
"alpha_frac": 0.7024555904,
"autogenerated": false,
"ratio": 3.3637961335676625... |
"""$Id: compatibility.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
... | {
"repo_name": "mihaip/NewsBlur",
"path": "vendor/feedvalidator/compatibility.py",
"copies": "16",
"size": "1047",
"license": "mit",
"hash": 2528938566534896000,
"line_mean": 27.2972972973,
"line_max": 94,
"alpha_frac": 0.6695319962,
"autogenerated": false,
"ratio": 3.163141993957704,
"config_te... |
"""
Python 2/3 compatibility definitions.
This module currently provides the following helper symbols:
* bytes (name of byte string type; str in 2.x, bytes in 3.x)
* b (function converting a string literal to an ASCII byte string;
can be also used to convert a Unicode string into a byte string)
* u_prefix (unicode... | {
"repo_name": "Soya93/Extract-Refactoring",
"path": "python/helpers/py2only/docutils/_compat.py",
"copies": "5",
"size": "1097",
"license": "apache-2.0",
"hash": -5964214987455566000,
"line_mean": 30.3428571429,
"line_max": 66,
"alpha_frac": 0.6526891522,
"autogenerated": false,
"ratio": 3.584967... |
"""
Python 2/3 compatibility definitions.
This module currently provides the following helper symbols:
* bytes (name of byte string type; str in 2.x, bytes in 3.x)
* b (function converting a string literal to an ASCII byte string;
can be also used to convert a Unicode string into a byte string)
* u_prefix... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "docutils/_compat.py",
"copies": "2",
"size": "1178",
"license": "bsd-3-clause",
"hash": -4621123537055207000,
"line_mean": 30.7222222222,
"line_max": 66,
"alpha_frac": 0.6375212224,
"autogenerated": false,
"ratio": 3.6697819314641746,
"config_test... |
"""
Python 2/3 compatibility definitions.
This module currently provides the following helper symbols:
* bytes (name of byte string type; str in 2.x, bytes in 3.x)
* b (function converting a string literal to an ASCII byte string;
can be also used to convert a Unicode string into a byte string)
* u_prefix (unicode... | {
"repo_name": "ddd332/presto",
"path": "presto-docs/target/sphinx/docutils/_compat.py",
"copies": "4",
"size": "1183",
"license": "apache-2.0",
"hash": -1744322731788892000,
"line_mean": 30.972972973,
"line_max": 66,
"alpha_frac": 0.6584953508,
"autogenerated": false,
"ratio": 3.617737003058104,
... |
"""Complex drawing objects."""
from pygame import Surface, SRCALPHA, surfarray
class FaderSurface (Surface):
"""FaderSurface (width, height, alpha=255) -> FaderSurface
A pygame.Surface class, that supports alpha fading.
The FaderSurface is an enhanced 32-bit pygame.Surface, that supports
alpha ... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/draw/Complex.py",
"copies": "1",
"size": "5240",
"license": "bsd-2-clause",
"hash": 3423823274545998300,
"line_mean": 37.2481751825,
"line_max": 79,
"alpha_frac": 0.6494274809,
"autogenerated": false,
"ratio": 4.28454619787408,
"config_test": fal... |
import time
import datetime
class ComplicatedTime:
def __init__(self, year):
self.year = year
# params for tos-time module
self.year_seconds = 0
self.wday_offset = 0
if self.year % 4:
self.isleap = False
else:
self.isleap = True
se... | {
"repo_name": "ekiwi/tinyos-1.x",
"path": "contrib/handhelds/tools/scripts/ComplicatedTime.py",
"copies": "2",
"size": "5615",
"license": "bsd-3-clause",
"hash": -5726697777855302000,
"line_mean": 38.2657342657,
"line_max": 99,
"alpha_frac": 0.5934105076,
"autogenerated": false,
"ratio": 3.594750... |
"""
Docutils component-related transforms.
"""
__docformat__ = 'reStructuredText'
from docutils.transforms import Transform
class Filter(Transform):
"""
Include or exclude elements which depend on a specific Docutils component.
For use with `nodes.pending` elements. A "pending" element's dictionary
... | {
"repo_name": "leafclick/intellij-community",
"path": "python/helpers/py3only/docutils/transforms/components.py",
"copies": "49",
"size": "1851",
"license": "apache-2.0",
"hash": -8461568939808082000,
"line_mean": 39.2391304348,
"line_max": 78,
"alpha_frac": 0.6866558617,
"autogenerated": false,
... |
"""
Docutils component-related transforms.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import time
from docutils import nodes, utils
from docutils import ApplicationError, DataError
from docutils.transforms import Transform, TransformError
class Filter(Transform):
"""
Include or ... | {
"repo_name": "akiokio/centralfitestoque",
"path": "src/.pycharm_helpers/docutils/transforms/components.py",
"copies": "1",
"size": "2003",
"license": "bsd-2-clause",
"hash": -5812997957689690000,
"line_mean": 37.5192307692,
"line_max": 84,
"alpha_frac": 0.6994508238,
"autogenerated": false,
"rat... |
"""
Docutils component-related transforms.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import time
from docutils import nodes, utils
from docutils import ApplicationError, DataError
from docutils.transforms import Transform, TransformError
class Filter(Transform):
"... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "docutils/transforms/components.py",
"copies": "2",
"size": "2045",
"license": "bsd-3-clause",
"hash": 2142520015116600000,
"line_mean": 37.3269230769,
"line_max": 78,
"alpha_frac": 0.680195599,
"autogenerated": false,
"ratio": 4.190573770491803,
"... |
"""Constants used by the ocempgui.draw module.
Font style constants
--------------------
Font style flsgs influence the rendering of the font and add, dependant
on the set flags, a bold, italic or underlined layout (or an combination
of those three).
The font flags are grouped in the FONT_STYLE_TYPES tuple.
FONT_ST... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/draw/Constants.py",
"copies": "1",
"size": "2585",
"license": "bsd-2-clause",
"hash": 3366401402950442000,
"line_mean": 38.1666666667,
"line_max": 78,
"alpha_frac": 0.7357833656,
"autogenerated": false,
"ratio": 3.8410104011887074,
"config_test":... |
"""Constants used by the ocempgui widgets module.
General constants
-----------------
General constants denote values, which are used for multiple purposes
and usually not limited to specific widget class parts.
DEFAULTDATADIR
Path to the directory where theme files and additional resources were
installed. This path... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Constants.py",
"copies": "1",
"size": "14896",
"license": "bsd-2-clause",
"hash": -1831841270256650200,
"line_mean": 32.0288248337,
"line_max": 78,
"alpha_frac": 0.7609425349,
"autogenerated": false,
"ratio": 3.825372367745249,
"config_te... |
"""An abstract widget, which can hold other widgets."""
from BaseWidget import BaseWidget
class Container (BaseWidget):
"""Container () -> Container
A container widget class, which can hold multiple other widgets.
The Container class is an abstract class, which can hold multiple
widgets. It is usab... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Container.py",
"copies": "1",
"size": "12012",
"license": "bsd-2-clause",
"hash": -6932945010455478000,
"line_mean": 34.9640718563,
"line_max": 78,
"alpha_frac": 0.6127206127,
"autogenerated": false,
"ratio": 4.822159775190687,
"config_te... |
"""$Id: content.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from ... | {
"repo_name": "stone5495/NewsBlur",
"path": "vendor/feedvalidator/content.py",
"copies": "16",
"size": "6021",
"license": "mit",
"hash": 6620676962272808000,
"line_mean": 38.8741721854,
"line_max": 121,
"alpha_frac": 0.6454077396,
"autogenerated": false,
"ratio": 3.4074702886247876,
"config_tes... |
""" Core classes referenced by adapters to perform Peloton tasks. No
adapter provides services that are other than published interfaces
to methods in these classes."""
import peloton.utils.logging as logging
from peloton.exceptions import NoWorkersError
from peloton.exceptions import DeadProxyError
from peloton.except... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/coreio.py",
"copies": "1",
"size": "10604",
"license": "bsd-3-clause",
"hash": 4628732080276864000,
"line_mean": 41.2470119522,
"line_max": 103,
"alpha_frac": 0.6423990947,
"autogenerated": false,
"ratio": 4.298338062423997,
"config_test": ... |
"""
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior. For custom behavior (setting component options), create
custom component objects first, and pass *them* to
``publish_*``/`Publisher`. See `The Docutils Publisher`_.
... | {
"repo_name": "rimbalinux/LMD3",
"path": "docutils/core.py",
"copies": "2",
"size": "29126",
"license": "bsd-3-clause",
"hash": -8649670899984873000,
"line_mean": 43.0170015456,
"line_max": 81,
"alpha_frac": 0.6092838014,
"autogenerated": false,
"ratio": 4.424426553243202,
"config_test": true,
... |
"""
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior. For custom behavior (setting component options), create
custom component objects first, and pass *them* to
``publish_*``/`Publisher`. See `The Docutils Publisher`_.
.. _T... | {
"repo_name": "neumerance/deploy",
"path": ".venv/lib/python2.7/site-packages/docutils/core.py",
"copies": "4",
"size": "29656",
"license": "apache-2.0",
"hash": 7813100253511853000,
"line_mean": 43.4617691154,
"line_max": 78,
"alpha_frac": 0.6234151605,
"autogenerated": false,
"ratio": 4.3817966... |
# $Id: crc32c.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import array
# CRC-32C Checksum for SCTP
# http://tools.ietf.org/html/rfc3309
crc32c_table = (
0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F,
0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, 0x8A... | {
"repo_name": "smutt/dpkt",
"path": "dpkt/crc32c.py",
"copies": "3",
"size": "4444",
"license": "bsd-3-clause",
"hash": 6715323622813542000,
"line_mean": 41.7307692308,
"line_max": 76,
"alpha_frac": 0.7304230423,
"autogenerated": false,
"ratio": 1.831067161104244,
"config_test": false,
"has_n... |
# $Id: crc32c.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
import array
# CRC-32C Checksum
# http://tools.ietf.org/html/rfc3309
crc32c_table = (
0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL,
0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, 0x78B2DBCCL,
0x6BE22838L, 0x... | {
"repo_name": "hexcap/dpkt",
"path": "dpkt/crc32c.py",
"copies": "6",
"size": "4160",
"license": "bsd-3-clause",
"hash": -5374550263356379000,
"line_mean": 49.1204819277,
"line_max": 68,
"alpha_frac": 0.7584134615,
"autogenerated": false,
"ratio": 1.7028243962341383,
"config_test": false,
"ha... |
# $Id: crc32c.py 23 2006-11-08 15:45:33Z dugsong $
import array
# CRC-32C Checksum
# http://tools.ietf.org/html/rfc3309
crc32c_table = (
0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL,
0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, 0x78B2DBCCL,
0x6BE22838L, 0x9989AB3BL, 0x4D43CFD0L,... | {
"repo_name": "dproc/trex_odp_porting_integration",
"path": "scripts/external_libs/dpkt-1.8.6/dpkt/crc32c.py",
"copies": "15",
"size": "4138",
"license": "apache-2.0",
"hash": -1433405102775106800,
"line_mean": 50.725,
"line_max": 68,
"alpha_frac": 0.7600289995,
"autogenerated": false,
"ratio": 1... |
# $Id: crossdomain.py 671 2011-02-02 23:59:24Z shreyas $
from django import http
import logging
from django.conf import settings
from urlparse import urlparse
from netaddr import all_matching_cidrs
from socket import gethostbyname
logger = logging.getLogger(__name__)
logger.setLevel(getattr(settings, 'LOG_LEVEL', logg... | {
"repo_name": "wentixiaogege/newt-2.0",
"path": "newt/crossdomain.py",
"copies": "3",
"size": "2858",
"license": "bsd-2-clause",
"hash": 2447988337192249000,
"line_mean": 36.1168831169,
"line_max": 97,
"alpha_frac": 0.6501049685,
"autogenerated": false,
"ratio": 3.9972027972027973,
"config_test... |
""" Provides cryptographic services """
import random
import base64
import cPickle as pickle
from peloton.exceptions import PelotonError
from Crypto.PublicKey import RSA
from Crypto.Util.randpool import RandomPool
# default character set on which to draw to make cookies
tokenspace = "abcdefghijklmnopqrstuvwxyzABCDEFGH... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/utils/crypto.py",
"copies": "1",
"size": "3093",
"license": "bsd-3-clause",
"hash": 4804750385254920000,
"line_mean": 30.2525252525,
"line_max": 77,
"alpha_frac": 0.6618170061,
"autogenerated": false,
"ratio": 3.94515306122449,
"config_test... |
# $Id: CycleCreators.py 344 2012-12-13 13:10:53Z krasznaa $
##########################################################################
# Project: SFrame - ROOT-based analysis framework for ATLAS #
# #
# author Stefan Ask <Stefan.A... | {
"repo_name": "jpavel/cms-ucl-tau",
"path": "SFrame/python/CycleCreators.py",
"copies": "1",
"size": "21701",
"license": "mit",
"hash": -1106553094682084900,
"line_mean": 33.7216,
"line_max": 96,
"alpha_frac": 0.5840744666,
"autogenerated": false,
"ratio": 4.086047825268311,
"config_test": true... |
# $Id: data.py,v 1.1 2011/03/19 01:52:27 paus Exp $
import FWCore.ParameterSet.Config as cms
process = cms.Process('FILLER')
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration.StandardSeq... | {
"repo_name": "cpausmit/Kraken",
"path": "filefi/016/data.py",
"copies": "1",
"size": "1870",
"license": "mit",
"hash": 1876015633848288500,
"line_mean": 35.6666666667,
"line_max": 154,
"alpha_frac": 0.7834224599,
"autogenerated": false,
"ratio": 2.992,
"config_test": true,
"has_no_keywords":... |
# $Id: data.py,v 1.1 2013/07/10 02:25:44 paus Exp $
import FWCore.ParameterSet.Config as cms
process = cms.Process('FILEFI')
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration.StandardSeq... | {
"repo_name": "cpausmit/Kraken",
"path": "filefi/032/data.py",
"copies": "1",
"size": "2092",
"license": "mit",
"hash": -8401774625456348000,
"line_mean": 37.7407407407,
"line_max": 113,
"alpha_frac": 0.7385277247,
"autogenerated": false,
"ratio": 2.913649025069638,
"config_test": true,
"has_... |
# $Id: data.py,v 1.2 2013/06/29 03:15:04 paus Exp $
import FWCore.ParameterSet.Config as cms
process = cms.Process('FILEFI')
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration.StandardSeq... | {
"repo_name": "cpausmit/Kraken",
"path": "filefi/031/data.py",
"copies": "1",
"size": "2023",
"license": "mit",
"hash": 7404146062349658000,
"line_mean": 37.1698113208,
"line_max": 113,
"alpha_frac": 0.7360355907,
"autogenerated": false,
"ratio": 2.919191919191919,
"config_test": true,
"has_n... |
# $Id: data.py,v 1.3 2010/10/23 12:43:55 ceballos Exp $
import FWCore.ParameterSet.Config as cms
process = cms.Process('FILLER')
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration/Standar... | {
"repo_name": "cpausmit/Kraken",
"path": "filefi/014/data.py",
"copies": "1",
"size": "1820",
"license": "mit",
"hash": 9082743460944804000,
"line_mean": 35.4,
"line_max": 154,
"alpha_frac": 0.7774725275,
"autogenerated": false,
"ratio": 2.964169381107492,
"config_test": true,
"has_no_keyword... |
# $Id: dbexts.py 4185 2008-02-28 16:55:33Z cgroves $
"""
This script provides platform independence by wrapping Python
Database API 2.0 compatible drivers to allow seamless database
usage across implementations.
In order to use the C version, you need mxODBC and mxDateTime.
In order to use the Java version, you need ... | {
"repo_name": "babble/babble",
"path": "include/jython/Lib/dbexts.py",
"copies": "1",
"size": "31053",
"license": "apache-2.0",
"hash": -1132955567386362900,
"line_mean": 41.7727272727,
"line_max": 134,
"alpha_frac": 0.4419540785,
"autogenerated": false,
"ratio": 4.534608644859813,
"config_test... |
# $Id: dbexts.py 6638 2009-08-10 17:05:49Z fwierzbicki $
"""
This script provides platform independence by wrapping Python
Database API 2.0 compatible drivers to allow seamless database
usage across implementations.
In order to use the C version, you need mxODBC and mxDateTime.
In order to use the Java version, you n... | {
"repo_name": "ftomassetti/intellij-community",
"path": "python/lib/Lib/dbexts.py",
"copies": "74",
"size": "25541",
"license": "apache-2.0",
"hash": 834296514198689000,
"line_mean": 34.1804407713,
"line_max": 126,
"alpha_frac": 0.5374887436,
"autogenerated": false,
"ratio": 3.728613138686131,
... |
# $Id: dbexts.py,v 1.4 2001/12/29 18:00:15 bzimmer Exp $
"""
This script provides platform independence by wrapping Python
Database API 2.0 compatible drivers to allow seamless database
usage across implementations.
In order to use the C version, you need mxODBC and mxDateTime.
In order to use the Java version, you n... | {
"repo_name": "Integral-Technology-Solutions/ConfigNOW",
"path": "Lib/dbexts.py",
"copies": "2",
"size": "20653",
"license": "mit",
"hash": -7604733996391548000,
"line_mean": 28.931884058,
"line_max": 120,
"alpha_frac": 0.6440710793,
"autogenerated": false,
"ratio": 2.867675645653985,
"config_t... |
# $Id: dbexts.py,v 1.5 2002/01/07 04:59:50 bzimmer Exp $
"""
This script provides platform independence by wrapping Python
Database API 2.0 compatible drivers to allow seamless database
usage across implementations.
In order to use the C version, you need mxODBC and mxDateTime.
In order to use the Java version, you n... | {
"repo_name": "ai-ku/langvis",
"path": "dependencies/jython-2.1/Lib/dbexts.py",
"copies": "2",
"size": "20664",
"license": "mit",
"hash": 3432014883960493000,
"line_mean": 28.7752161383,
"line_max": 120,
"alpha_frac": 0.643437863,
"autogenerated": false,
"ratio": 2.869202999166898,
"config_test... |
# $Id: debug.py,v 1.3 2010/10/23 12:43:55 ceballos Exp $
import FWCore.ParameterSet.Config as cms
process = cms.Process('FILLER')
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration/Standa... | {
"repo_name": "cpausmit/Kraken",
"path": "filefi/014/debug.py",
"copies": "1",
"size": "1936",
"license": "mit",
"hash": 5936773567815664000,
"line_mean": 36.2307692308,
"line_max": 154,
"alpha_frac": 0.7804752066,
"autogenerated": false,
"ratio": 3.010886469673406,
"config_test": true,
"has_... |
"""Default drawing engine."""
import os.path
import pygame, pygame.transform
from ocempgui.draw import Draw, String, Image
from ocempgui.widgets.StyleInformation import StyleInformation
from ocempgui.widgets.Constants import *
# Function cache
array3d = pygame.surfarray.array3d
blit_array = pygame.surfarray.blit_ar... | {
"repo_name": "prim/ocempgui",
"path": "data/themes/default/DefaultEngine.py",
"copies": "1",
"size": "57426",
"license": "bsd-2-clause",
"hash": -2948845936167941600,
"line_mean": 39.0181184669,
"line_max": 80,
"alpha_frac": 0.5459722077,
"autogenerated": false,
"ratio": 4.0012541806020065,
"c... |
# tab:2
#
#
# "Copyright (c) 2000-2005 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement is
# hereby granted, provided that the above copyri... | {
"repo_name": "ekiwi/tinyos-1.x",
"path": "contrib/nestfe/nesc/apps/DelugeDemo/DelugeDemoGui.py",
"copies": "2",
"size": "5093",
"license": "bsd-3-clause",
"hash": 1248256254951846400,
"line_mean": 33.1812080537,
"line_max": 100,
"alpha_frac": 0.62085215,
"autogenerated": false,
"ratio": 3.313597... |
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted, provided that the above copyright notice, the follo... | {
"repo_name": "fresskarma/tinyos-1.x",
"path": "contrib/nestfe/python/pytos/Deluge.py",
"copies": "2",
"size": "2132",
"license": "bsd-3-clause",
"hash": 2218043131843665400,
"line_mean": 30.8208955224,
"line_max": 82,
"alpha_frac": 0.6899624765,
"autogenerated": false,
"ratio": 3.167904903417533... |
"""An abstract widget for diagram and graph implementations."""
from BaseWidget import BaseWidget
from Constants import *
import base
class Diagram (BaseWidget):
"""Diagram () -> Diagram
An abstract widget class for diagram and graph implementations.
The Diagram class contains the minimum set of attrib... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Diagram.py",
"copies": "1",
"size": "12618",
"license": "bsd-2-clause",
"hash": 9003016170335364000,
"line_mean": 35.8947368421,
"line_max": 79,
"alpha_frac": 0.6329053733,
"autogenerated": false,
"ratio": 4.52258064516129,
"config_test":... |
"""A modal window suitable for dialogs and similar purposes."""
from Window import Window
from ocempgui.events import EventManager
class DialogWindow (Window):
"""DialogWindow (title=None) -> DialogWindow
A modal window widget, which blocks any other input.
The DialogWindow sets itself and its children... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/DialogWindow.py",
"copies": "1",
"size": "2845",
"license": "bsd-2-clause",
"hash": 6185230607747743000,
"line_mean": 39.6428571429,
"line_max": 79,
"alpha_frac": 0.7026362039,
"autogenerated": false,
"ratio": 4.32370820668693,
"config_te... |
# $Id: diameter.py 23 2006-11-08 15:45:33Z dugsong $
"""Diameter."""
import struct
import dpkt
# Diameter Base Protocol - RFC 3588
# http://tools.ietf.org/html/rfc3588
# Request/Answer Command Codes
ABORT_SESSION = 274
ACCOUTING = 271
CAPABILITIES_EXCHANGE = 257
DEVICE_WATCHDOG = 280
DISCONNECT_PEER = 282
RE_AU... | {
"repo_name": "ashrith/dpkt",
"path": "dpkt/diameter.py",
"copies": "15",
"size": "5848",
"license": "bsd-3-clause",
"hash": 4676060708779074000,
"line_mean": 31.3093922652,
"line_max": 190,
"alpha_frac": 0.4972640219,
"autogenerated": false,
"ratio": 2.8223938223938223,
"config_test": true,
... |
# $Id: display.py,v 1.1 2004/08/14 22:18:28 jp Exp $
from __future__ import generators
from Tkinter import *
from math import pi,sin,cos
from base import BaseObject
RADS_PER_DEG = pi/180
DEGS_PER_RAD = 180/pi
def pol2cart(r,theta):
x = r * cos(theta)
y = r * sin(theta)
return x,y
def enum(seq):
i =... | {
"repo_name": "ronaldahmed/robot-navigation",
"path": "neural-navigation-with-lstm/MARCO/plastk/display.py",
"copies": "2",
"size": "4588",
"license": "mit",
"hash": -8028202697278231000,
"line_mean": 27.1472392638,
"line_max": 104,
"alpha_frac": 0.5494768963,
"autogenerated": false,
"ratio": 3.1... |
import optparse, os, platform, sys, shutil, subprocess, shlex
def getHostOS():
host_os = "win_x64"
if platform.system().lower().startswith("win"):
if 'PROGRAMFILES(X86)' in os.environ:
host_os = "win_x64"
else:
host_os = "win_32"
elif platform.system().lower().start... | {
"repo_name": "perfectsearch/sandman",
"path": "code/buildscripts/distfunctions.py",
"copies": "1",
"size": "7239",
"license": "mit",
"hash": 1207912189858357800,
"line_mean": 37.5053191489,
"line_max": 173,
"alpha_frac": 0.5855781185,
"autogenerated": false,
"ratio": 3.8220696937697993,
"confi... |
"""Reader for existing document trees."""
from docutils import readers, utils, transforms
class Reader(readers.ReReader):
"""
Adapt the Reader API for an existing document tree.
The existing document tree must be passed as the ``source`` parameter to
the `docutils.core.Publisher` initializer, wrap... | {
"repo_name": "juanmont/one",
"path": ".vscode/extensions/tht13.rst-vscode-2.0.0/src/python/docutils/readers/doctree.py",
"copies": "246",
"size": "1607",
"license": "apache-2.0",
"hash": -6472174062464439000,
"line_mean": 33.9347826087,
"line_max": 77,
"alpha_frac": 0.6726820162,
"autogenerated": ... |
"""Reader for existing document trees."""
from docutils import readers, utils, transforms
class Reader(readers.ReReader):
"""
Adapt the Reader API for an existing document tree.
The existing document tree must be passed as the ``source`` parameter to
the `docutils.core.Publisher` initi... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "docutils/readers/doctree.py",
"copies": "2",
"size": "1653",
"license": "bsd-3-clause",
"hash": -8188344925744133000,
"line_mean": 33.9347826087,
"line_max": 77,
"alpha_frac": 0.6539624924,
"autogenerated": false,
"ratio": 4.443548387096774,
"conf... |
"""
Simple internal document tree Writer, writes Docutils XML.
"""
__docformat__ = 'reStructuredText'
import docutils
from docutils import frontend, writers
class Writer(writers.Writer):
supported = ('xml',)
"""Formats this writer supports."""
settings_spec = (
'"Docutils XML" Writer Options... | {
"repo_name": "alekseyev/wheatleycms",
"path": "docutils/writers/docutils_xml.py",
"copies": "66",
"size": "2727",
"license": "bsd-3-clause",
"hash": 8807744361097495000,
"line_mean": 36.3561643836,
"line_max": 79,
"alpha_frac": 0.6050605061,
"autogenerated": false,
"ratio": 4.1633587786259545,
... |
"""
Simple internal document tree Writer, writes Docutils XML.
"""
__docformat__ = 'reStructuredText'
import docutils
from docutils import frontend, writers
class Writer(writers.Writer):
supported = ('xml',)
"""Formats this writer supports."""
settings_spec = (
'"Docutils X... | {
"repo_name": "rimbalinux/LMD3",
"path": "docutils/writers/docutils_xml.py",
"copies": "2",
"size": "2800",
"license": "bsd-3-clause",
"hash": -8488675864830142000,
"line_mean": 36.3561643836,
"line_max": 79,
"alpha_frac": 0.5892857143,
"autogenerated": false,
"ratio": 4.236006051437216,
"confi... |
"""
Simple document tree Writer, writes Docutils XML according to
http://docutils.sourceforge.net/docs/ref/docutils.dtd.
"""
__docformat__ = 'reStructuredText'
import sys
import xml.sax.saxutils
from StringIO import StringIO
import docutils
from docutils import frontend, writers, nodes
class RawXmlError(docutils.... | {
"repo_name": "mcr/ietfdb",
"path": "docutils/writers/docutils_xml.py",
"copies": "4",
"size": "6271",
"license": "bsd-3-clause",
"hash": -2182509082923135700,
"line_mean": 34.0335195531,
"line_max": 79,
"alpha_frac": 0.6080369957,
"autogenerated": false,
"ratio": 4.045806451612903,
"config_tes... |
"""
Simple document tree Writer, writes Docutils XML according to
http://docutils.sourceforge.net/docs/ref/docutils.dtd.
"""
__docformat__ = 'reStructuredText'
import sys
# Work around broken PyXML and obsolete python stdlib behaviour. (The stdlib
# replaces its own xml module with PyXML if the latter is installed.... | {
"repo_name": "mglukhikh/intellij-community",
"path": "python/helpers/py3only/docutils/writers/docutils_xml.py",
"copies": "46",
"size": "6973",
"license": "apache-2.0",
"hash": -6924664598543777000,
"line_mean": 35.3177083333,
"line_max": 97,
"alpha_frac": 0.6238347913,
"autogenerated": false,
"... |
# $Id: dpkt.py 43 2007-08-02 22:42:59Z jon.oberheide $
# -*- coding: utf-8 -*-
"""Simple packet creation and parsing."""
from __future__ import absolute_import
import copy
import itertools
import socket
import struct
import array
from .compat import compat_ord, compat_izip, iteritems
class Error(Exception):
pa... | {
"repo_name": "dimagol/trex-core",
"path": "scripts/external_libs/dpkt-1.9.1/dpkt/dpkt.py",
"copies": "3",
"size": "7224",
"license": "apache-2.0",
"hash": -2979717684457334300,
"line_mean": 32.1376146789,
"line_max": 275,
"alpha_frac": 0.4944629014,
"autogenerated": false,
"ratio": 3.64112903225... |
# $Id: dpkt.py 43 2007-08-02 22:42:59Z jon.oberheide $
# -*- coding: utf-8 -*-
"""Simple packet creation and parsing."""
import copy
import itertools
import socket
import struct
import array
class Error(Exception):
pass
class UnpackError(Error):
pass
class NeedData(UnpackError):
pass
class PackErro... | {
"repo_name": "yangbh/dpkt",
"path": "dpkt/dpkt.py",
"copies": "1",
"size": "7213",
"license": "bsd-3-clause",
"hash": 4597679080673776600,
"line_mean": 32.2396313364,
"line_max": 278,
"alpha_frac": 0.4887009566,
"autogenerated": false,
"ratio": 3.745067497403946,
"config_test": false,
"has_n... |
# $Id: echo.py 90 2008-01-16 17:08:42Z ghandal $
# echo.py - demonstracja pygglib - Gadu-Gadu echo
# (c) Marek Chrusciel
# Jakub Kosinski
# Marcin Krupowicz
# Mateusz Strycharski
#
import time
import sys
if sys.platform == 'win32':
sys.path.append(".\\..") # - dla windowsa
else:
sys.path.app... | {
"repo_name": "jakubkosinski/pygglib",
"path": "samples/echo.py",
"copies": "1",
"size": "3692",
"license": "mit",
"hash": 5466477677088465000,
"line_mean": 33.5,
"line_max": 172,
"alpha_frac": 0.6952871073,
"autogenerated": false,
"ratio": 2.9394904458598727,
"config_test": false,
"has_no_ke... |
# TODO: Handle text selections
"""Abstract text editing class."""
from pygame.locals import *
from BaseWidget import BaseWidget
from Constants import *
import base
_TIMER = 50
class Editable (BaseWidget):
"""Editable () -> Editable
An abstract widget class, which can handle text input.
The Editable i... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Editable.py",
"copies": "1",
"size": "11582",
"license": "bsd-2-clause",
"hash": -3502954222686398500,
"line_mean": 34.9689440994,
"line_max": 78,
"alpha_frac": 0.5865135555,
"autogenerated": false,
"ratio": 4.415554708349219,
"config_tes... |
from Tkinter import *
import Pmw
class CD_handler:
def import_CD_tempscan(self):
"""Import a temperature scan from a Jasco CD spec"""
import tkFileDialog, os
filename=tkFileDialog.askopenfilename(defaultextension='.txt',initialdir=os.getcwd(),
... | {
"repo_name": "dmnfarrell/peat",
"path": "PEATDB/Ekin/Ekin_CD.py",
"copies": "1",
"size": "11253",
"license": "mit",
"hash": 5894380464278538000,
"line_mean": 30.8781869688,
"line_max": 132,
"alpha_frac": 0.516484493,
"autogenerated": false,
"ratio": 3.538679245283019,
"config_test": false,
"... |
"""$Id: en.py 747 2007-03-29 10:27:14Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 747 $"
__date__ = "$Date: 2007-03-29 10:27:14 +0000 (Thu, 29 Mar 2007) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
import fee... | {
"repo_name": "manderson23/NewsBlur",
"path": "vendor/feedvalidator/i18n/en.py",
"copies": "16",
"size": "14502",
"license": "mit",
"hash": 7871399160008374000,
"line_mean": 68.3875598086,
"line_max": 179,
"alpha_frac": 0.6741828713,
"autogenerated": false,
"ratio": 4.030572540300167,
"config_t... |
"""$Id: entry.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from ba... | {
"repo_name": "Einsteinish/PyTune3",
"path": "vendor/feedvalidator/entry.py",
"copies": "16",
"size": "4034",
"license": "mit",
"hash": 3719198430064036400,
"line_mean": 31.272,
"line_max": 119,
"alpha_frac": 0.665840357,
"autogenerated": false,
"ratio": 3.601785714285714,
"config_test": false,... |
"""A widget, which handles text input."""
from Editable import Editable
from ocempgui.draw import String
from Constants import *
import base
class Entry (Editable):
"""Entry (text="") -> Entry
A widget class suitable for a single line of text input.
The Entry widget is a text input box for a single lin... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Entry.py",
"copies": "1",
"size": "11696",
"license": "bsd-2-clause",
"hash": 6193064870625271000,
"line_mean": 36.2484076433,
"line_max": 79,
"alpha_frac": 0.5942202462,
"autogenerated": false,
"ratio": 4.140176991150443,
"config_test": ... |
# $Id: ErrorCatchers.py,v 1.7 2005/01/03 19:59:07 tavis_rudd Exp $
"""ErrorCatcher class for Cheetah Templates
Meta-Data
================================================================================
Author: Tavis Rudd <tavis@damnsimple.com>
Version: $Revision: 1.7 $
Start Date: 2001/08/01
Last Revision Date: $Date:... | {
"repo_name": "dragondjf/QMarkdowner",
"path": "Cheetah/ErrorCatchers.py",
"copies": "16",
"size": "1755",
"license": "mit",
"hash": 3103235015702775300,
"line_mean": 27.3064516129,
"line_max": 82,
"alpha_frac": 0.5897435897,
"autogenerated": false,
"ratio": 3.567073170731707,
"config_test": fa... |
# $Id: ethernet.py 65 2010-03-26 02:53:51Z dugsong $
# -*- coding: utf-8 -*-
"""Ethernet II, LLC (802.3+802.2), LLC/SNAP, and Novell raw 802.3,
with automatic 802.1q, MPLS, PPPoE, and Cisco ISL decapsulation."""
import struct
import dpkt
import stp
ETH_CRC_LEN = 4
ETH_HDR_LEN = 14
ETH_LEN_MIN = 64 # minimum frame ... | {
"repo_name": "bpanneton/dpkt",
"path": "dpkt/ethernet.py",
"copies": "5",
"size": "5375",
"license": "bsd-3-clause",
"hash": 3753075930122482700,
"line_mean": 35.0738255034,
"line_max": 84,
"alpha_frac": 0.568,
"autogenerated": false,
"ratio": 2.8289473684210527,
"config_test": false,
"has_n... |
"""Event management system for any type of events and objects."""
from Signals import Event
from INotifyable import INotifyable
class EventManager (object):
"""EventManager () -> EventManager
An event distribution system.
The EventManager enables objects to receive events. Each object can
register ... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/events/EventManager.py",
"copies": "1",
"size": "7259",
"license": "bsd-2-clause",
"hash": -5009778052737995000,
"line_mean": 38.8846153846,
"line_max": 79,
"alpha_frac": 0.6343849015,
"autogenerated": false,
"ratio": 4.57403906742281,
"config_te... |
from twisted.spread.pb import DeadReferenceError
""" Core interface to the event bus. This module also contains
a base class for all event bus plugins.
The interface may differ and the provider also, but Peloton contrains
the message bus to one that supports the AMQP protocol as defined
at http://amqp.org/.
The me... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/events.py",
"copies": "1",
"size": "8619",
"license": "bsd-3-clause",
"hash": -4803046973787079000,
"line_mean": 38.3561643836,
"line_max": 120,
"alpha_frac": 0.6592412113,
"autogenerated": false,
"ratio": 4.493743482794578,
"config_test": ... |
"""
This module contains practical examples of Docutils client code.
Importing this module from client code is not recommended; its contents are
subject to change in future Docutils releases. Instead, it is recommended
that you copy and paste the parts you need into your own code, modifying as
necessary.
"""
from d... | {
"repo_name": "adieu/allbuttonspressed",
"path": "docutils/examples.py",
"copies": "66",
"size": "3940",
"license": "bsd-3-clause",
"hash": 2305290964698974200,
"line_mean": 40.0416666667,
"line_max": 77,
"alpha_frac": 0.6870558376,
"autogenerated": false,
"ratio": 4.138655462184874,
"config_te... |
"""
This module contains practical examples of Docutils client code.
Importing this module from client code is not recommended; its contents are
subject to change in future Docutils releases. Instead, it is recommended
that you copy and paste the parts you need into your own code, modifying as
necessary.
"""... | {
"repo_name": "rimbalinux/LMD3",
"path": "docutils/examples.py",
"copies": "2",
"size": "4036",
"license": "bsd-3-clause",
"hash": -5802761906913425000,
"line_mean": 40.0416666667,
"line_max": 77,
"alpha_frac": 0.6707135778,
"autogenerated": false,
"ratio": 4.208550573514077,
"config_test": fal... |
import sys
sys.path.append( "../../glapi_parser" )
import apiutil
apiutil.CopyrightC()
print """
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY expando.py SCRIPT */
#include <stdio.h>
#include "cr_error.h"
#include "cr_spu.h"
#include "cr_dlm.h"
#include "expandospu.h"
"""
allFunctions = []
generatedFunction... | {
"repo_name": "egraba/vbox_openbsd",
"path": "VirtualBox-5.0.0/src/VBox/HostServices/SharedOpenGL/expando/expando.py",
"copies": "3",
"size": "2992",
"license": "mit",
"hash": -7037906131233853000,
"line_mean": 31.8791208791,
"line_max": 101,
"alpha_frac": 0.7075534759,
"autogenerated": false,
"r... |
"""$Id: extension.py 750 2007-04-06 18:40:28Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net>, Mark Pilgrim <http://diveintomark.org/> and Phil Ringnalda <http://philringnalda.com>"
__version__ = "$Revision: 750 $"
__date__ = "$Date: 2007-04-06 18:40:28 +0000 (Fri, 06 Apr 2007) $"
__copyright__ = "Copyrigh... | {
"repo_name": "slava-sh/NewsBlur",
"path": "vendor/feedvalidator/extension.py",
"copies": "16",
"size": "30895",
"license": "mit",
"hash": -3998763994073540600,
"line_mean": 26.7583108715,
"line_max": 136,
"alpha_frac": 0.641236446,
"autogenerated": false,
"ratio": 3.4795585088410856,
"config_t... |
# $Id: f25618704b7ebe12c191cc1a51055c26db731b85 $
"""
Gadfly extended database driver.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import os
import sys
... | {
"repo_name": "illicitonion/givabit",
"path": "lib/sdks/google_appengine_1.7.1/google_appengine/lib/grizzled/grizzled/db/dbgadfly.py",
"copies": "19",
"size": "5495",
"license": "apache-2.0",
"hash": -9154142955900766000,
"line_mean": 28.7027027027,
"line_max": 79,
"alpha_frac": 0.4946314832,
"auto... |
# $Id: f38a8ecb542b475e96a9f613b3bd9bc269f2473d $
"""
SQL Server extended database driver.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import os
import ... | {
"repo_name": "Kazade/NeHe-Website",
"path": "google_appengine/lib/grizzled/grizzled/db/sqlserver.py",
"copies": "19",
"size": "3923",
"license": "bsd-3-clause",
"hash": -7382432226359239000,
"line_mean": 30.6370967742,
"line_max": 80,
"alpha_frac": 0.4496558756,
"autogenerated": false,
"ratio": ... |
# $Id: f485c4e2802f66973d04d5047ee9d3e5cfd249ce $
"""
PostgreSQL extended database driver.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import os
import ... | {
"repo_name": "gauribhoite/personfinder",
"path": "env/google_appengine/lib/grizzled/grizzled/db/postgresql.py",
"copies": "19",
"size": "7987",
"license": "apache-2.0",
"hash": -2194436294461057500,
"line_mean": 34.1850220264,
"line_max": 80,
"alpha_frac": 0.4768999624,
"autogenerated": false,
"... |
# $Id: f8ce5bf718c826df5fb3cd06701dc2bf6e144acb $
"""
Network-related methods and classes.
"""
from __future__ import absolute_import
__docformat__ = 'restructuredtext en'
# ---------------------------------------------------------------------------
# Imports
# -------------------------------------------------------... | {
"repo_name": "undoware/neutron-drive",
"path": "google_appengine/lib/grizzled/grizzled/net/__init__.py",
"copies": "19",
"size": "3602",
"license": "bsd-3-clause",
"hash": 619234990109712600,
"line_mean": 33.9708737864,
"line_max": 93,
"alpha_frac": 0.5038867296,
"autogenerated": false,
"ratio":... |
# $Id: fa873c96e7b5ed23437473a2b6d0b9a3871d4a18 $
"""
Introduction
============
The ``db`` module is a DB API wrapper. It provides a DB API-compliant API that
wraps real underlying DB API drivers, simplifying some non-portable operations
like ``connect()`` and providing some new operations.
Some drivers come bundled... | {
"repo_name": "overtherain/scriptfile",
"path": "software/googleAppEngine/lib/grizzled/grizzled/db/__init__.py",
"copies": "19",
"size": "6667",
"license": "mit",
"hash": -4993002045308931000,
"line_mean": 31.5219512195,
"line_max": 78,
"alpha_frac": 0.5083245838,
"autogenerated": false,
"ratio":... |
"""$Id: feed.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from bas... | {
"repo_name": "Suninus/NewsBlur",
"path": "vendor/feedvalidator/feed.py",
"copies": "16",
"size": "3754",
"license": "mit",
"hash": -8333954536131213000,
"line_mean": 28.7936507937,
"line_max": 121,
"alpha_frac": 0.6587639851,
"autogenerated": false,
"ratio": 3.666015625,
"config_test": false,
... |
# $Id: feeds.py 5ee3537e5395 2009/08/22 11:31:30 jpartogi $
from django.utils.translation import ugettext as _
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.utils.feedgenerator import Atom1Feed
from simple_blog.models import Entry, Category
class EntriesFee... | {
"repo_name": "jpartogi/django-simple-blog",
"path": "simple_blog/feeds.py",
"copies": "1",
"size": "1576",
"license": "bsd-3-clause",
"hash": 6331282401669285000,
"line_mean": 31.1836734694,
"line_max": 90,
"alpha_frac": 0.6224619289,
"autogenerated": false,
"ratio": 3.8817733990147785,
"confi... |
"""File selection dialog class."""
import os
from GenericDialog import GenericDialog
from FileList import FileList
from Frame import HFrame
from Label import Label
from Entry import Entry
from Constants import *
class FileDialog (GenericDialog):
"""FileDialog (title, buttons, results, directory=None) -> FileDial... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/FileDialog.py",
"copies": "1",
"size": "4548",
"license": "bsd-2-clause",
"hash": -6716973550813876000,
"line_mean": 37.8717948718,
"line_max": 78,
"alpha_frac": 0.6791996482,
"autogenerated": false,
"ratio": 4.3396946564885495,
"config_t... |
"""A list item suitable for displaying file and directory information."""
import os, stat
from ocempgui.draw import Image
from ListItem import TextListItem
from ocempgui.widgets.images import Icons16x16
from ocempgui.widgets.Constants import *
from ocempgui.widgets import base
class FileListItem (TextListItem):
... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/components/FileListItem.py",
"copies": "1",
"size": "4455",
"license": "bsd-2-clause",
"hash": -8782361504192421000,
"line_mean": 45.40625,
"line_max": 79,
"alpha_frac": 0.6316498316,
"autogenerated": false,
"ratio": 4.527439024390244,
"c... |
"""Filesystem browsing and selection list."""
import os, stat
from pygame import K_RETURN
from ocempgui.widgets.components import ListItemCollection, FileListItem
from ScrolledList import ScrolledList
from Constants import *
import base
class FileList (ScrolledList):
"""FileList (width, height, directory=None) -... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/FileList.py",
"copies": "1",
"size": "6315",
"license": "bsd-2-clause",
"hash": 8816359107555256000,
"line_mean": 38.46875,
"line_max": 79,
"alpha_frac": 0.632304038,
"autogenerated": false,
"ratio": 4.475549255846917,
"config_test": fals... |
""" $Id: filetail.py 1512 2011-05-20 16:14:29Z morrissj $
Python3 module for tailing a file such as a system log that grows continuously.
Transparently handles files that get rotated or trucated.
Inspired by the Perl File::Tail module.
A simple algorithm is used to dynamically sleep when no new data is available in
t... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/577710_Tail_continuously_growing_file_like_tail_f/recipe-577710.py",
"copies": "1",
"size": "9171",
"license": "mit",
"hash": -2320170067840393700,
"line_mean": 33.477443609,
"line_max": 122,
"alpha_frac": 0.5318940137,
"autogenerated": fals... |
"""Widget classes, which can place their chidren in a horizontal or
vertical alignment.
"""
from Container import Container
from BaseWidget import BaseWidget
from Constants import *
import base
class Frame (Container):
"""Frame (widget=None) -> Frame
A container widget class with decorative border.
The... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Frame.py",
"copies": "1",
"size": "13967",
"license": "bsd-2-clause",
"hash": -3982400045983180000,
"line_mean": 33.6575682382,
"line_max": 78,
"alpha_frac": 0.595403451,
"autogenerated": false,
"ratio": 4.463726430169383,
"config_test": ... |
"""
Command-line and common processing for Docutils front-end tools.
Exports the following classes:
* `OptionParser`: Standard Docutils command-line processing.
* `Option`: Customized version of `optparse.Option`; validation support.
* `Values`: Runtime settings; objects are simple structs
(``object.attribute``). ... | {
"repo_name": "bobthecow/ManipulateCoda",
"path": "src/Support/Library/docutils/frontend.py",
"copies": "6",
"size": "33065",
"license": "mit",
"hash": -2262406258164184600,
"line_mean": 42.4494086728,
"line_max": 82,
"alpha_frac": 0.5704218963,
"autogenerated": false,
"ratio": 4.44302606826122,
... |
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to transform a lone top level section's title to
the document title, promote a remaining lone top-level section's
title to the document subtitle, and determine the document's title
... | {
"repo_name": "PatrickKennedy/Sybil",
"path": "docutils/transforms/frontmatter.py",
"copies": "2",
"size": "18886",
"license": "bsd-2-clause",
"hash": -1540852886770211000,
"line_mean": 35.88671875,
"line_max": 82,
"alpha_frac": 0.5627978397,
"autogenerated": false,
"ratio": 4.696841581696096,
... |
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to transform a lone top level section's title to
the document title, promote a remaining lone top-level section's
title to the document subtitle, and determine the document's t... | {
"repo_name": "rimbalinux/LMD3",
"path": "docutils/transforms/frontmatter.py",
"copies": "2",
"size": "19391",
"license": "bsd-3-clause",
"hash": -5619662392838649000,
"line_mean": 35.873046875,
"line_max": 82,
"alpha_frac": 0.5478830385,
"autogenerated": false,
"ratio": 4.778462296697881,
"con... |
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to transform a lone top level section's title to
the document title, promote a remaining lone top-level section's
title to the document subtitle, and determine the document's title
... | {
"repo_name": "retomerz/intellij-community",
"path": "python/helpers/py3only/docutils/transforms/frontmatter.py",
"copies": "44",
"size": "19348",
"license": "apache-2.0",
"hash": -7820445597537339000,
"line_mean": 35.5746691871,
"line_max": 82,
"alpha_frac": 0.5625387637,
"autogenerated": false,
... |
"""
Miscellaneous functions for use with Python code,
mostly based on Haskell library elements.
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2011-2013, Graham Klyne, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
from operator import concat, and_,... | {
"repo_name": "wf4ever/ro-manager",
"path": "src/MiscUtils/Functions.py",
"copies": "1",
"size": "9492",
"license": "mit",
"hash": 8216408904901107000,
"line_mean": 26.0427350427,
"line_max": 84,
"alpha_frac": 0.5685840708,
"autogenerated": false,
"ratio": 3.552395209580838,
"config_test": fals... |
# $Id: Functions.py 1047 2009-01-15 14:48:58Z graham $
#
"""
Miscellaneous functions for use with Python code,
mostly based on Haskell library elements.
"""
from operator import concat, and_, or_
def concatMap(f,vs):
"""
Map function over list and concatenate results.
"""
return reduce( concat, map (... | {
"repo_name": "bhavanaananda/DataStage",
"path": "src/AdminUIHandler/MiscLib/Functions.py",
"copies": "8",
"size": "9308",
"license": "mit",
"hash": 7179975320672336000,
"line_mean": 25.8242074928,
"line_max": 84,
"alpha_frac": 0.5671465406,
"autogenerated": false,
"ratio": 3.5703874184886844,
... |
"""An universal dialog window class with additional buttons."""
from DialogWindow import DialogWindow
from Frame import VFrame, HFrame
from Button import Button
from Constants import *
class GenericDialog (DialogWindow):
"""GenericDialog (title, buttons, results) -> GenericDialog
A generic dialog window, wh... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/GenericDialog.py",
"copies": "1",
"size": "7328",
"license": "bsd-2-clause",
"hash": -7258221487424784000,
"line_mean": 40.1685393258,
"line_max": 78,
"alpha_frac": 0.6375545852,
"autogenerated": false,
"ratio": 4.509538461538462,
"config... |
"""
This file retrieves deployments from an Octopus application
"""
import logging, json, requests, time, sys
import ConfigParser
import splunk.Intersplunk as isp
import octopus_common
# Parse octopus.conf for configuration settings
stanza = octopus_common.getSelfConfStanza("octopus")
protocol = stanza['protocol']
h... | {
"repo_name": "cmeerbeek/splunk-addon-octopus-deploy",
"path": "TA-OctopusNIX-Fwd/bin/get_deployments.py",
"copies": "2",
"size": "2057",
"license": "mit",
"hash": 8702554263712645000,
"line_mean": 29.2647058824,
"line_max": 101,
"alpha_frac": 0.6796305299,
"autogenerated": false,
"ratio": 3.6732... |
"""
This file retrieves environments from an Octopus application
"""
import logging, json, requests, time, sys
import ConfigParser
import splunk.Intersplunk as isp
import octopus_common
# Parse octopus.conf for configuration settings
stanza = octopus_common.getSelfConfStanza("octopus")
protocol = stanza['protocol']
... | {
"repo_name": "cmeerbeek/splunk-addon-octopus-deploy",
"path": "TA-OctopusNIX-Fwd/bin/get_environments.py",
"copies": "2",
"size": "1187",
"license": "mit",
"hash": -1971521100591519500,
"line_mean": 23.75,
"line_max": 69,
"alpha_frac": 0.7270429655,
"autogenerated": false,
"ratio": 3.41091954022... |
"""
This file retrieves events from an Octopus application
"""
import logging, json, requests, time, sys
import ConfigParser
import splunk.Intersplunk as isp
import octopus_common
# Parse octopus.conf for configuration settings
stanza = octopus_common.getSelfConfStanza("octopus")
protocol = stanza['protocol']
hostna... | {
"repo_name": "cmeerbeek/splunk-addon-octopus-deploy",
"path": "TA-OctopusNT-Fwd/bin/get_events.py",
"copies": "2",
"size": "1966",
"license": "mit",
"hash": -354156397359731140,
"line_mean": 27.1,
"line_max": 86,
"alpha_frac": 0.6658189217,
"autogenerated": false,
"ratio": 3.5296229802513466,
... |
"""
This file retrieves machines from an Octopus application
"""
import logging, json, requests, time, sys
import ConfigParser
import splunk.Intersplunk as isp
import octopus_common
# Parse octopus.conf for configuration settings
stanza = octopus_common.getSelfConfStanza("octopus")
protocol = stanza['protocol']
host... | {
"repo_name": "cmeerbeek/splunk-addon-octopus-deploy",
"path": "TA-OctopusNIX-Fwd/bin/get_machines.py",
"copies": "2",
"size": "1163",
"license": "mit",
"hash": 6930123404532113000,
"line_mean": 23.25,
"line_max": 65,
"alpha_frac": 0.7214101462,
"autogenerated": false,
"ratio": 3.3419540229885056... |
"""
This file retrieves projects from an Octopus application
"""
import logging, json, requests, time, sys
import ConfigParser
import splunk.Intersplunk as isp
import octopus_common
# Parse octopus.conf for configuration settings
stanza = octopus_common.getSelfConfStanza("octopus")
protocol = stanza['protocol']
host... | {
"repo_name": "cmeerbeek/splunk-addon-octopus-deploy",
"path": "TA-OctopusNT-Fwd/bin/get_projects.py",
"copies": "2",
"size": "1165",
"license": "mit",
"hash": -6451146240734415000,
"line_mean": 23.2916666667,
"line_max": 65,
"alpha_frac": 0.7201716738,
"autogenerated": false,
"ratio": 3.34770114... |
"""
This file retrieves releases from an Octopus application
"""
import logging, json, requests, time, sys
import ConfigParser
import splunk.Intersplunk as isp
import octopus_common
# Parse octopus.conf for configuration settings
stanza = octopus_common.getSelfConfStanza("octopus")
protocol = stanza['protocol']
host... | {
"repo_name": "cmeerbeek/splunk-addon-octopus-deploy",
"path": "TA-OctopusNIX-Fwd/bin/get_releases.py",
"copies": "2",
"size": "1974",
"license": "mit",
"hash": 617843590866885800,
"line_mean": 27.6231884058,
"line_max": 92,
"alpha_frac": 0.6742654509,
"autogenerated": false,
"ratio": 3.595628415... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.