text stringlengths 0 1.05M | meta dict |
|---|---|
# $Id$
"""Internet Control Message Protocol for IPv6."""
import dpkt, ip6
ICMP6_DST_UNREACH = 1 # dest unreachable, codes:
ICMP6_PACKET_TOO_BIG = 2 # packet too big
ICMP6_TIME_EXCEEDED = 3 # time exceeded, code:
ICMP6_PARAM_PROB = 4 # ip6 header bad
IC... | {
"repo_name": "djhenderson/dpkt",
"path": "dpkt/icmp6.py",
"copies": "17",
"size": "2604",
"license": "bsd-3-clause",
"hash": -4893693534180753000,
"line_mean": 35.1666666667,
"line_max": 74,
"alpha_frac": 0.5399385561,
"autogenerated": false,
"ratio": 3.3994778067885116,
"config_test": false,
... |
# $Id$
"""Internet Protocol, version 6."""
import dpkt
class IP6(dpkt.Packet):
__hdr__ = (
('v_fc_flow', 'I', 0x60000000L),
('plen', 'H', 0), # payload length (not including header)
('nxt', 'B', 0), # next header protocol
('hlim', 'B', 0), # hop limit
('src', '16s', ''),
... | {
"repo_name": "afghanistanyn/dpkt",
"path": "dpkt/ip6.py",
"copies": "17",
"size": "12002",
"license": "bsd-3-clause",
"hash": 8089525888408985000,
"line_mean": 38.0944625407,
"line_max": 376,
"alpha_frac": 0.5405765706,
"autogenerated": false,
"ratio": 2.903943866440842,
"config_test": true,
... |
# $Id$
#
# Locate all standard modules available in this build.
#
# This script is designed to run on Python 1.5.2 and newer.
#
# Written by Fredrik Lundh, January 2005
#
import imp, sys, os, re, time
identifier = "python-%s-%s" % (sys.version[:3], sys.platform)
timestamp = time.strftime("%Y%m%dT%H%M%SZ", time.gmtime... | {
"repo_name": "hr4e/QuestionnaireQx",
"path": "listmodules.py",
"copies": "1",
"size": "3420",
"license": "apache-2.0",
"hash": 5849893026299655000,
"line_mean": 26.1428571429,
"line_max": 70,
"alpha_frac": 0.5347953216,
"autogenerated": false,
"ratio": 3.5849056603773586,
"config_test": true,
... |
# $Id$
"""mime - MIME decoding Library"""
import rfc822, re
import cStringIO as StringIO
class Error(Exception):
pass
class Entity(rfc822.Message):
def __init__(self, msg, mime=0, eol=r"\r\n", headers=None):
if headers is not None:
fp = StringIO.StringIO(headers + "\n" + msg)
else:
fp = St... | {
"repo_name": "jribbens/jonpy",
"path": "jon/mime.py",
"copies": "1",
"size": "5681",
"license": "mit",
"hash": -6548297419265174000,
"line_mean": 26.8480392157,
"line_max": 79,
"alpha_frac": 0.5653934167,
"autogenerated": false,
"ratio": 3.3222222222222224,
"config_test": false,
"has_no_keyw... |
# $Id:$
'''Minimal Windows COM interface.
Allows pyglet to use COM interfaces on Windows without comtypes. Unlike
comtypes, this module does not provide property interfaces, read typelibs,
nice-ify return values or permit Python implementations of COM interfaces. We
don't need anything that sophisticated to work wi... | {
"repo_name": "hazelnusse/sympy-old",
"path": "sympy/thirdparty/pyglet/pyglet/com.py",
"copies": "5",
"size": "3535",
"license": "bsd-3-clause",
"hash": -6399041892013928000,
"line_mean": 29.2136752137,
"line_max": 78,
"alpha_frac": 0.6297029703,
"autogenerated": false,
"ratio": 3.636831275720164... |
# $Id$
"""Miscellaneous functions that are part of the vtk_kit.
This module is imported by vtk_kit.init() after the rest of the vtk_kit has
been initialised. To use these functions in your module code, do e.g.:
import moduleKits; moduleKits.vtk_kit.misc.flatterProp3D(obj);
@author: Charl P. Botha <http://cpbotha.ne... | {
"repo_name": "codester2/devide",
"path": "module_kits/vtk_kit/misc.py",
"copies": "7",
"size": "2776",
"license": "bsd-3-clause",
"hash": 905408408086246400,
"line_mean": 28.5319148936,
"line_max": 78,
"alpha_frac": 0.6585014409,
"autogenerated": false,
"ratio": 3.3047619047619046,
"config_tes... |
# $Id$
"""Multi-threaded Routing Toolkit."""
import dpkt
import bgp
# Multi-threaded Routing Toolkit
# http://www.ietf.org/internet-drafts/draft-ietf-grow-mrt-03.txt
# MRT Types
NULL = 0
START = 1
DIE = 2
I_AM_DEAD = 3
PEER_DOWN = 4
BGP = 5 # Deprecated by BGP4MP
RIP = 6
IDRP = 7
RIPNG = 8
BGP4PLUS ... | {
"repo_name": "lzp819739483/dpkt",
"path": "dpkt/mrt.py",
"copies": "17",
"size": "1939",
"license": "bsd-3-clause",
"hash": -1127289880551056800,
"line_mean": 20.0760869565,
"line_max": 64,
"alpha_frac": 0.472408458,
"autogenerated": false,
"ratio": 2.581890812250333,
"config_test": false,
"... |
# $Id$
#----------------------------------------------------------------------
# Name: Logger.py
# Purpose: Provides a Logger class which can be wrapped around another
# python class to log method calls and attribute changes.
# Requires: Python 2.0 (or higher?)
#
# Author: greg Landrum (... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/Logger/Logger.py",
"copies": "2",
"size": "7290",
"license": "bsd-3-clause",
"hash": 3352629666295961600,
"line_mean": 29.5020920502,
"line_max": 108,
"alpha_frac": 0.6330589849,
"autogenerated": false,
"ratio": 4.204152249134948,
"config_test": ... |
# $Id$
blurbs = {}
blurbs[1] = ('blurb_image_1_jpg',
'beluga whale',
"""
Beluga whales of the St. Lawrence estuary (SLE) have been found to have cancer rates "much higher than those observed in domestic animals and humans, except in sheep in certain parts of the world, where env... | {
"repo_name": "dchud/sentinel",
"path": "canary/ui/tour_blurb.py",
"copies": "1",
"size": "2964",
"license": "mit",
"hash": 7512383045770744000,
"line_mean": 64.8666666667,
"line_max": 676,
"alpha_frac": 0.6892712551,
"autogenerated": false,
"ratio": 2.993939393939394,
"config_test": false,
"... |
# $Id$
class FakeFile(object):
def __init__(self):
self.closed = 0
self.softspace = 0
self._buf = ""
self.chunksize = 4096
self.newlines = None
def close(self):
self.closed = 1
def _check_open(self):
if self.closed:
raise IOError("File is closed")
def flush(self):
self... | {
"repo_name": "jribbens/jonpy",
"path": "jon/fakefile.py",
"copies": "1",
"size": "2622",
"license": "mit",
"hash": -4884186683223600000,
"line_mean": 19.1692307692,
"line_max": 68,
"alpha_frac": 0.5560640732,
"autogenerated": false,
"ratio": 3.5384615384615383,
"config_test": false,
"has_no_... |
# $Id$
"""Network Basic Input/Output System."""
import struct
import dpkt, dns
def encode_name(name):
"""Return the NetBIOS first-level encoded name."""
l = []
for c in struct.pack('16s', name):
c = ord(c)
l.append(chr((c >> 4) + 0x41))
l.append(chr((c & 0xf) + 0x41))
return '... | {
"repo_name": "warjiang/dpkt",
"path": "dpkt/netbios.py",
"copies": "17",
"size": "4963",
"license": "bsd-3-clause",
"hash": -7701020746320438000,
"line_mean": 31.2272727273,
"line_max": 87,
"alpha_frac": 0.5218617772,
"autogenerated": false,
"ratio": 2.957687723480334,
"config_test": false,
... |
# $Id$
"""
Google App Engine Script that handles administration screens for the
blog.
"""
import cgi
import logging
import xmlrpc
import xmlrpclib
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import urlfetch
fro... | {
"repo_name": "bmc/picoblog",
"path": "admin.py",
"copies": "1",
"size": "6107",
"license": "bsd-3-clause",
"hash": -790064542897241200,
"line_mean": 32.3715846995,
"line_max": 79,
"alpha_frac": 0.5167840183,
"autogenerated": false,
"ratio": 4.4674469641550845,
"config_test": false,
"has_no_k... |
# $Id$
"""
Google App Engine Script that handles display of the published
items in the blog.
"""
__docformat__ = 'restructuredtext'
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging... | {
"repo_name": "bmc/picoblog",
"path": "blog.py",
"copies": "1",
"size": "11584",
"license": "bsd-3-clause",
"hash": 631293038713389600,
"line_mean": 32.4797687861,
"line_max": 79,
"alpha_frac": 0.4752244475,
"autogenerated": false,
"ratio": 4.800663075010361,
"config_test": false,
"has_no_key... |
# $Id$
"""
Handles pinging Technorati for the blog.
"""
__docformat__ = 'restructuredtext' # for Epydoc
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import sys
import xmlrpclib
import logging... | {
"repo_name": "bmc/picoblog",
"path": "xmlrpc.py",
"copies": "1",
"size": "2454",
"license": "bsd-3-clause",
"hash": 5033407257696745000,
"line_mean": 30.4615384615,
"line_max": 79,
"alpha_frac": 0.423797881,
"autogenerated": false,
"ratio": 5.577272727272727,
"config_test": false,
"has_no_ke... |
# $Id$
"""
Introduction
============
``fortune`` is a stripped-down implementation of the classic BSD Unix
``fortune`` command. It combines the capabilities of the ``strfile`` command
(which produces the fortune index file) and the ``fortune`` command (which
displays a random fortune). It reads the traditional ``fort... | {
"repo_name": "sean-smith/fortune",
"path": "fortune/__init__.py",
"copies": "1",
"size": "9779",
"license": "bsd-3-clause",
"hash": 3352750646916822000,
"line_mean": 32.9548611111,
"line_max": 81,
"alpha_frac": 0.6141732283,
"autogenerated": false,
"ratio": 3.922583233052547,
"config_test": fa... |
# $Id$
"""
RST support.
"""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging
import os
import sys
import StringIO
from docutils import core, nodes, parsers
from docutils.parsers.rs... | {
"repo_name": "bmc/picoblog",
"path": "rst.py",
"copies": "1",
"size": "4041",
"license": "bsd-3-clause",
"hash": -8632255579918680000,
"line_mean": 30.5703125,
"line_max": 81,
"alpha_frac": 0.5251175452,
"autogenerated": false,
"ratio": 4.465193370165746,
"config_test": false,
"has_no_keywor... |
# $Id$
"""
The stpyfits module is an extension to the `astropy.io.fits` module which offers
additional features specific to STScI. These features include the handling
of Constant Data Value Arrays.
"""
import functools
import numpy as np
import astropy
from astropy.io import fits
# A few imports for backward compat... | {
"repo_name": "spacetelescope/stsci.tools",
"path": "lib/stsci/tools/stpyfits.py",
"copies": "1",
"size": "12764",
"license": "bsd-3-clause",
"hash": -3045296125214106600,
"line_mean": 36.1046511628,
"line_max": 87,
"alpha_frac": 0.5692572861,
"autogenerated": false,
"ratio": 4.163078930202218,
... |
# $Id$
"""Point-to-Point Protocol."""
import struct
import dpkt
# XXX - finish later
# http://www.iana.org/assignments/ppp-numbers
PPP_IP = 0x21 # Internet Protocol
PPP_IP6 = 0x57 # Internet Protocol v6
# Protocol field compression
PFC_BIT = 0x01
class PPP(dpkt.Packet):
__hdr__ = (
('p', 'B', PPP_IP... | {
"repo_name": "mennis/dpkt",
"path": "dpkt/ppp.py",
"copies": "17",
"size": "1563",
"license": "bsd-3-clause",
"hash": -4180740707023803000,
"line_mean": 23.8095238095,
"line_max": 74,
"alpha_frac": 0.5227127319,
"autogenerated": false,
"ratio": 3.2698744769874475,
"config_test": false,
"has_... |
# $Id$
_q_exports = [
'contact_us',
'study_methodologies',
'linkage',
'tour',
'disclaimer',
'questionnaire',
]
import sys
from quixote import get_publisher
from quixote.util import StaticFile
from canary.qx_defs import NotLoggedInError
from canary.qx_utils import MyStaticFile, load_stati... | {
"repo_name": "dchud/sentinel",
"path": "canary/ui/about/__init__.py",
"copies": "1",
"size": "1314",
"license": "mit",
"hash": 760567959031896300,
"line_mean": 24.7647058824,
"line_max": 84,
"alpha_frac": 0.696347032,
"autogenerated": false,
"ratio": 3.204878048780488,
"config_test": false,
... |
# $Id$
_q_exports = [
'queue',
'record',
'session',
'source',
'source_map',
'sources',
'term',
'user',
'users',
'concept',
'category',
'dv_data',
'auto',
'reload_sources',
]
import string
from quixote.errors import AccessError, PublishError, TraversalError
... | {
"repo_name": "dchud/sentinel",
"path": "canary/ui/admin/__init__.py",
"copies": "1",
"size": "1209",
"license": "mit",
"hash": 5519176664952375000,
"line_mean": 22.7058823529,
"line_max": 68,
"alpha_frac": 0.7080231596,
"autogenerated": false,
"ratio": 3.3214285714285716,
"config_test": false,... |
# $Id$
"""Real-Time Transport Protocol"""
from dpkt import Packet
# version 1100 0000 0000 0000 ! 0xC000 14
# p 0010 0000 0000 0000 ! 0x2000 13
# x 0001 0000 0000 0000 ! 0x1000 12
# cc 0000 1111 0000 0000 ! 0x0F00 8
# m 0000 0000 1000 0000 ! 0x0080 7
# pt 0000 0000 0111 1111 ! 0x00... | {
"repo_name": "af001/dpkt",
"path": "dpkt/rtp.py",
"copies": "17",
"size": "2265",
"license": "bsd-3-clause",
"hash": -4305897177762907000,
"line_mean": 31.3571428571,
"line_max": 79,
"alpha_frac": 0.5373068433,
"autogenerated": false,
"ratio": 2.5709421112372306,
"config_test": false,
"has_n... |
# $Id$
"""Remote Authentication Dial-In User Service."""
import dpkt
# http://www.untruth.org/~josh/security/radius/radius-auth.html
# RFC 2865
class RADIUS(dpkt.Packet):
__hdr__ = (
('code', 'B', 0),
('id', 'B', 0),
('len', 'H', 4),
('auth', '16s', '')
)
attrs = ''
... | {
"repo_name": "GTiroadkill/dpkt",
"path": "dpkt/radius.py",
"copies": "18",
"size": "2106",
"license": "bsd-3-clause",
"hash": -7291517830581431000,
"line_mean": 22.9318181818,
"line_max": 69,
"alpha_frac": 0.650997151,
"autogenerated": false,
"ratio": 2.4689331770222744,
"config_test": false,
... |
# $Id$
"""Remote Procedure Call."""
import struct
import dpkt
# RPC.dir
CALL = 0
REPLY = 1
# RPC.Auth.flavor
AUTH_NONE = AUTH_NULL = 0
AUTH_UNIX = 1
AUTH_SHORT = 2
AUTH_DES = 3
# RPC.Reply.stat
MSG_ACCEPTED = 0
MSG_DENIED = 1
# RPC.Reply.Accept.stat
SUCCESS = 0
PROG_UNAVAIL = 1
PROG_MISMATCH = 2
PROC_UNAVAIL = 3
... | {
"repo_name": "warjiang/dpkt",
"path": "dpkt/rpc.py",
"copies": "17",
"size": "4817",
"license": "bsd-3-clause",
"hash": 8962395186154282000,
"line_mean": 31.9931506849,
"line_max": 78,
"alpha_frac": 0.467718497,
"autogenerated": false,
"ratio": 3.4855282199710564,
"config_test": false,
"has_... |
# $Id: $
#
# See http://pyunit.sourceforge.net/pyunit.html
#
import cgi, SubmitDatasetUtils, os, re
from rdflib import URIRef
def setDatasetsBaseDir(base):
global DatasetsBaseDir
DatasetsBaseDir = base
#global HostName = "zoo-admiral-behav.zoo.ox.ac.uk"
#global HostName = "zoo-... | {
"repo_name": "bhavanaananda/DataStage",
"path": "src/SubmitDatasetHandler/tests/TestConfig.py",
"copies": "1",
"size": "5825",
"license": "mit",
"hash": -3460042218677464000,
"line_mean": 58.4387755102,
"line_max": 136,
"alpha_frac": 0.5210300429,
"autogenerated": false,
"ratio": 4.0507649513212... |
# $Id$
"""Snoop file format."""
import sys, time
import dpkt
# RFC 1761
SNOOP_MAGIC = 0x736E6F6F70000000L
SNOOP_VERSION = 2
SDL_8023 = 0
SDL_8024 = 1
SDL_8025 = 2
SDL_8026 = 3
SDL_ETHER = 4
SDL_HDLC = 5
SDL_CHSYNC = 6
SDL_IBMCC = 7
SDL_FDDI = 8
SDL_OTHER = 9
dltoff = { SDL_ETHER:14 }
class PktHd... | {
"repo_name": "warjiang/dpkt",
"path": "dpkt/snoop.py",
"copies": "22",
"size": "2963",
"license": "bsd-3-clause",
"hash": -4804749727115225000,
"line_mean": 24.1101694915,
"line_max": 78,
"alpha_frac": 0.4971312859,
"autogenerated": false,
"ratio": 3.1091290661070303,
"config_test": false,
"... |
# $Id: $
#
# Test configuration parameters
#
class TestConfig:
#hostname = "zoo-admiral-behav.zoo.ox.ac.uk"
#hostname = "zoo-admiral-silk.zoo.ox.ac.uk"
#hostname = "zoo-admiral-devel.zoo.ox.ac.uk"
#hostname = "zoo-admiral-ibrg.zoo.ox.ac.uk"
#hostname = "... | {
"repo_name": "bhavanaananda/DataStage",
"path": "test/FileShare/tests/TestConfig.py",
"copies": "1",
"size": "1074",
"license": "mit",
"hash": -6675034401838946000,
"line_mean": 30.5882352941,
"line_max": 88,
"alpha_frac": 0.5763500931,
"autogenerated": false,
"ratio": 2.871657754010695,
"conf... |
# $Id$
"""Transmission Control Protocol."""
import dpkt
# TCP control flags
TH_FIN = 0x01 # end of data
TH_SYN = 0x02 # synchronize sequence numbers
TH_RST = 0x04 # reset connection
TH_PUSH = 0x08 # push
TH_ACK = 0x10 # acknowledgment number set
TH_URG = 0x20 # urgent pointer set
TH_ECE = 0x40 # ECN ec... | {
"repo_name": "af001/dpkt",
"path": "dpkt/tcp.py",
"copies": "17",
"size": "3179",
"license": "bsd-3-clause",
"hash": 2078466677274853400,
"line_mean": 31.4387755102,
"line_max": 75,
"alpha_frac": 0.5769109783,
"autogenerated": false,
"ratio": 2.6804384485666106,
"config_test": false,
"has_no... |
# $Id$
"""Trivial File Transfer Protocol."""
import struct
import dpkt
# Opcodes
OP_RRQ = 1 # read request
OP_WRQ = 2 # write request
OP_DATA = 3 # data packet
OP_ACK = 4 # acknowledgment
OP_ERR = 5 # error code
# Error codes
EUNDEF = 0 # not defined
ENOTFOUND = 1 # file... | {
"repo_name": "xldrx/dpkt",
"path": "dpkt/tftp.py",
"copies": "16",
"size": "1676",
"license": "bsd-3-clause",
"hash": -4751037487932629000,
"line_mean": 29.4727272727,
"line_max": 74,
"alpha_frac": 0.5232696897,
"autogenerated": false,
"ratio": 3.1863117870722433,
"config_test": false,
"has_... |
# $Id$
#
"""unit testing code for 3D stuff
"""
from rdkit import RDConfig
import unittest, os
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import TorsionFingerprints
class TestCase(unittest.TestCase):
def testConformerRMS(self):
m1 = Chem.MolFromSmiles('CNc(n2)nc(C)cc2Nc(cc34)ccc3[nH]... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/Chem/UnitTestMol3D.py",
"copies": "1",
"size": "6852",
"license": "bsd-3-clause",
"hash": 4290156925621778400,
"line_mean": 43.2064516129,
"line_max": 100,
"alpha_frac": 0.7129305312,
"autogenerated": false,
"ratio": 2.9194716659565403,
"config_test"... |
# $Id$
#
# Usage:
# <Directory /where/ever>
# PythonOutputFilter gzipfilter
# SetOutputFilter gzipfilter
# </Directory>
from mod_python import apache
import os
import sys
import gzip
import cStringIO
from mod_python import apache
def compress(s):
sio = cStringIO.StringIO()
f = gzip.GzipFile(mod... | {
"repo_name": "Distrotech/mod_python",
"path": "examples/gzipfilter.py",
"copies": "1",
"size": "1620",
"license": "apache-2.0",
"hash": 2685012090594292700,
"line_mean": 21.5,
"line_max": 63,
"alpha_frac": 0.5827160494,
"autogenerated": false,
"ratio": 3.9416058394160585,
"config_test": false,... |
# $Id: $
#
# Utility functions for testing HTTP
#
import os
import sys
import httplib
import urllib2
from TestConfig import TestConfig
# Execute a specified HTTP method using a supplied urllib2 opener object,
# following a single HTTP 301 redirection response
def do_cifsMount(areaName, userName, userPass):
#pri... | {
"repo_name": "tectronics/admiral-jiscmrd",
"path": "test/FileShare/tests/TestCifsUtils.py",
"copies": "2",
"size": "2808",
"license": "mit",
"hash": -5463849125869422000,
"line_mean": 32.4285714286,
"line_max": 142,
"alpha_frac": 0.6160968661,
"autogenerated": false,
"ratio": 3.8100407055630936,... |
# $Id$
"""
Utility functions
"""
# Functions added here should really be as portable as possible
# and generally useful.
import os
import sys
import stat
import time
import logging
LOG = logging.getLogger(__name__)
def ensure_dir(dir_path):
"""
Ensure a directory path exists (by creating it if it doesn't).
... | {
"repo_name": "m00dawg/holland",
"path": "holland/core/util/path.py",
"copies": "1",
"size": "3916",
"license": "bsd-3-clause",
"hash": 9066763566823183000,
"line_mean": 23.6289308176,
"line_max": 77,
"alpha_frac": 0.598825332,
"autogenerated": false,
"ratio": 3.7690086621751684,
"config_test":... |
# $Id$
"""Virtual Router Redundancy Protocol."""
import dpkt
class VRRP(dpkt.Packet):
__hdr__ = (
('vtype', 'B', 0x21),
('vrid', 'B', 0),
('priority', 'B', 0),
('count', 'B', 0),
('atype', 'B', 0),
('advtime', 'B', 0),
('sum', 'H', 0),
)
addrs =... | {
"repo_name": "warjiang/dpkt",
"path": "dpkt/vrrp.py",
"copies": "17",
"size": "1230",
"license": "bsd-3-clause",
"hash": 6549160418411411000,
"line_mean": 25.170212766,
"line_max": 67,
"alpha_frac": 0.4707317073,
"autogenerated": false,
"ratio": 2.956730769230769,
"config_test": false,
"has_... |
# $Id$
"""Web Template system"""
import sys, os, re
import jon.cgi as cgi
_code_cache = {}
_replace_validchunk = re.compile("^[A-Za-z0-9_]+$")
def replace(wt, template, namespace):
"""Substitute variables in template and output with jcgi.write
Variables are indicated by surrounding them with "$$".
If the n... | {
"repo_name": "jribbens/jonpy",
"path": "jon/wt/__init__.py",
"copies": "1",
"size": "5588",
"license": "mit",
"hash": -8935102069301511000,
"line_mean": 27.2222222222,
"line_max": 80,
"alpha_frac": 0.6088045812,
"autogenerated": false,
"ratio": 3.5912596401028276,
"config_test": false,
"has_... |
# $Id$
# workaround to use adodbapi and other modules not
# included with DeVIDE
#import sys
#sys.path = sys.path + ['', 'H:\\bld\\bin\\Wrapping\\CSwig\\Python\\RelWithDebInfo', 'H:\\opt\\python23\\Lib\\site-packages\\adodbapi', 'C:\\WINNT\\System32\\python23.zip', 'H:\\', 'H:\\opt\\python23\\DLLs', 'H:\\opt\\python2... | {
"repo_name": "codester2/devide",
"path": "modules/user/reconstructionRDR.py",
"copies": "7",
"size": "5329",
"license": "bsd-3-clause",
"hash": -2715287726698264000,
"line_mean": 32.30625,
"line_max": 528,
"alpha_frac": 0.695440045,
"autogenerated": false,
"ratio": 3.277367773677737,
"config_t... |
# $Id$
# Train a mixture of Gaussians to approximate a multi-mode dataset.
# It seems fairly easy to fall into some local minimum. Good solutions
# have errors around -200.
# This example reproduces Fig. 5.21 from Bishop (2006).
__author__ = 'Martin Felder'
import pylab as p
import numpy as np
from pybrain.structure.... | {
"repo_name": "yonglehou/pybrain",
"path": "examples/supervised/neuralnets+svm/example_mixturedensity.py",
"copies": "26",
"size": "3548",
"license": "bsd-3-clause",
"hash": -6189743814080675000,
"line_mean": 32.4716981132,
"line_max": 95,
"alpha_frac": 0.6364148816,
"autogenerated": false,
"rati... |
# $Id$
import sys
if sys.platform == 'win32':
sys.path.append(".\\..") # - dla windowsa
else:
sys.path.append("../") # - dla linuksa
from pygglib import GGSession
from GGConstans import *
from Contacts import *
import time
def login_ok(sender, args):
print 'Zalogowano :>'
def print_msg(sender, args... | {
"repo_name": "jakubkosinski/pygglib",
"path": "tests/contacts_tests.py",
"copies": "1",
"size": "1946",
"license": "mit",
"hash": -1986436749114092500,
"line_mean": 36.1568627451,
"line_max": 207,
"alpha_frac": 0.6978417266,
"autogenerated": false,
"ratio": 2.913173652694611,
"config_test": fa... |
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, string='') - returns a new hash object implementing the
given hash function; initializing the hash
using the given string data.
Named constructor functions are also available, these... | {
"repo_name": "kubaszostak/gdal-dragndrop",
"path": "osgeo/apps/Python27/Lib/hashlib.py",
"copies": "7",
"size": "8063",
"license": "mit",
"hash": 2834929953636192000,
"line_mean": 34.4841628959,
"line_max": 84,
"alpha_frac": 0.6000248047,
"autogenerated": false,
"ratio": 4.0194416749750745,
"c... |
# $Id:$
from pyglet.media import Source, AudioFormat, AudioData
import ctypes
import os
import math
class ProceduralSource(Source):
def __init__(self, duration, sample_rate=44800, sample_size=16):
self._duration = float(duration)
self.audio_format = AudioFormat(
channels=1... | {
"repo_name": "certik/sympy-oldcore",
"path": "sympy/plotting/pyglet/media/procedural.py",
"copies": "1",
"size": "4932",
"license": "bsd-3-clause",
"hash": -8371373572432896000,
"line_mean": 31.1006711409,
"line_max": 79,
"alpha_frac": 0.5089213301,
"autogenerated": false,
"ratio": 4.29991281604... |
# $Id$
import sys
import unittest
if sys.platform == 'win32':
sys.path.append(".\\..") # - dla windowsa
else:
sys.path.append("../") # - dla linuksa
from GGConstans import *
from Contacts import *
class ContactUnitTest(unittest.TestCase):
def testCreateDictWithShownName(self):
uin =... | {
"repo_name": "jakubkosinski/pygglib",
"path": "tests/contacts_unit_test.py",
"copies": "1",
"size": "6829",
"license": "mit",
"hash": 3774160536988546600,
"line_mean": 37.0228571429,
"line_max": 193,
"alpha_frac": 0.6046273246,
"autogenerated": false,
"ratio": 4.081888822474596,
"config_test":... |
# $Id: 0d2e5b9d01530c575fc4f6834113699dda23cc4a $
"""
Input/Output utility methods and classes.
"""
from __future__ import absolute_import
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# -------------------------------------------------... | {
"repo_name": "yencarnacion/jaikuengine",
"path": ".google_appengine/lib/grizzled/grizzled/io/__init__.py",
"copies": "19",
"size": "11715",
"license": "apache-2.0",
"hash": 8707027021779322000,
"line_mean": 27.7837837838,
"line_max": 91,
"alpha_frac": 0.518822023,
"autogenerated": false,
"ratio"... |
# $Id: 209a_reg_handle_423_ok.py 3105 2010-02-23 11:03:07Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
"--realm=python --user=username --password=password " + \
"--auto-update-nat=0"
# 423 Response without Min-Expires header
req1 ... | {
"repo_name": "yuezhou/telephony",
"path": "telephony/Classes/pjproject-2.2.1/tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py",
"copies": "58",
"size": "1054",
"license": "mit",
"hash": -6292262118407778000,
"line_mean": 33,
"line_max": 99,
"alpha_frac": 0.6821631879,
"autogenerated": false,... |
# $Id: 230_reg_bad_fail_stale_true.py 2392 2008-12-22 18:54:58Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# In this test we simulate broken server, where it always sends
# stale=true with all 401 responses. We should expect pjsip to
# retry the authentication until PJSIP_MAX_STALE_COUNT is
# exceeded. When... | {
"repo_name": "crissmoldovan/tisip",
"path": "iphone/pjsip/src/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py",
"copies": "59",
"size": "1692",
"license": "mit",
"hash": 6406944162946690000,
"line_mean": 40.2682926829,
"line_max": 93,
"alpha_frac": 0.6731678487,
"autogenerated": false,... |
# $Id: 32c62bbf4b4a05fb16d4bc6894663370a8ae7ac9 $
#
# Nose program for testing grizzled.sys classes/functions
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
from __future__ import absolute_import
im... | {
"repo_name": "pigeonflight/strider-plone",
"path": "docker/appengine/lib/grizzled/grizzled/test/system/Test.py",
"copies": "19",
"size": "1909",
"license": "mit",
"hash": 3809478660899397600,
"line_mean": 33.0892857143,
"line_max": 77,
"alpha_frac": 0.4567836564,
"autogenerated": false,
"ratio":... |
# $Id: 55b6d7323887ac09f6bfba365205e952533b847b $
"""
The ``grizzled.text`` package contains text-related classes and modules.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------... | {
"repo_name": "Kazade/NeHe-Website",
"path": "google_appengine/lib/grizzled/grizzled/text/__init__.py",
"copies": "19",
"size": "6796",
"license": "bsd-3-clause",
"hash": -3050995639938421000,
"line_mean": 30.3179723502,
"line_max": 77,
"alpha_frac": 0.3893466745,
"autogenerated": false,
"ratio":... |
# $Id: 5e4fe45ea4436e0dc7d3743bff9679e052071746 $
# ---------------------------------------------------------------------------
"""
A dummy database driver, useful for testing.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# -------... | {
"repo_name": "bratsche/Neutron-Drive",
"path": "google_appengine/lib/grizzled/grizzled/db/dummydb.py",
"copies": "19",
"size": "1861",
"license": "bsd-3-clause",
"hash": 6302335774715545000,
"line_mean": 21.975308642,
"line_max": 77,
"alpha_frac": 0.4051585169,
"autogenerated": false,
"ratio": 5... |
# $Id: 8066a5bbef6962141ae539bef06493250cbeab57 $
"""
SQLite3 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/sqlite.py",
"copies": "19",
"size": "4689",
"license": "apache-2.0",
"hash": -169029207604199140,
"line_mean": 32.2553191489,
"line_max": 79,
"alpha_frac": 0.4399658776,
"autogen... |
# $Id: 969e4c5fd51bb174563d06c1357489c2742813ec $
"""
Base classes for enhanced DB drivers.
"""
from __future__ import absolute_import
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ------------------------------------------------------... | {
"repo_name": "bratsche/Neutron-Drive",
"path": "google_appengine/lib/grizzled/grizzled/db/base.py",
"copies": "19",
"size": "32027",
"license": "bsd-3-clause",
"hash": 88891257386059500,
"line_mean": 31.6806122449,
"line_max": 82,
"alpha_frac": 0.5133793362,
"autogenerated": false,
"ratio": 4.99... |
# $Id: 9efdb91769a07b38061d1041ac0486b77f362738 $
"""
Oracle extended database driver.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import os
import sys
... | {
"repo_name": "gauribhoite/personfinder",
"path": "env/google_appengine/lib/grizzled/grizzled/db/oracle.py",
"copies": "19",
"size": "5635",
"license": "apache-2.0",
"hash": 7818532810293178000,
"line_mean": 34.21875,
"line_max": 77,
"alpha_frac": 0.4557231588,
"autogenerated": false,
"ratio": 4.... |
# $Id: a384faeed9e9e609ca4b056c682c8ecda51f9e64 $
"""
MySQL extended database driver.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import os
import sys
i... | {
"repo_name": "pigeonflight/strider-plone",
"path": "docker/appengine/lib/grizzled/grizzled/db/mysql.py",
"copies": "19",
"size": "4138",
"license": "mit",
"hash": -6384937807591979000,
"line_mean": 28.5571428571,
"line_max": 78,
"alpha_frac": 0.4294345094,
"autogenerated": false,
"ratio": 4.6916... |
# $Id: admin.py e01f24bde54b 2009/09/06 13:55:06 jpartogi $
from django.contrib import admin
from django.core import urlresolvers
from django.utils.translation import ugettext as _
from contact_form.models import *
class SubjectAdmin(admin.ModelAdmin):
list_display = ('title', 'department_url')
def departme... | {
"repo_name": "jpartogi/django-contact-form",
"path": "contact_form/admin.py",
"copies": "1",
"size": "1209",
"license": "bsd-3-clause",
"hash": 4982201994005634000,
"line_mean": 35.6363636364,
"line_max": 108,
"alpha_frac": 0.699751861,
"autogenerated": false,
"ratio": 3.51453488372093,
"confi... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, directives
from docutils import nodes
class BaseAdmonition(Directive):
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = True
... | {
"repo_name": "PatrickKennedy/Sybil",
"path": "docutils/parsers/rst/directives/admonitions.py",
"copies": "2",
"size": "2189",
"license": "bsd-2-clause",
"hash": 1355361466040021200,
"line_mean": 21.5670103093,
"line_max": 76,
"alpha_frac": 0.6418455916,
"autogenerated": false,
"ratio": 3.9159212... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
class BaseAdmonition(Directive):
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = True
option... | {
"repo_name": "kdwink/intellij-community",
"path": "python/helpers/py2only/docutils/parsers/rst/directives/admonitions.py",
"copies": "5",
"size": "2173",
"license": "apache-2.0",
"hash": 4439197025685575700,
"line_mean": 21.6354166667,
"line_max": 76,
"alpha_frac": 0.641509434,
"autogenerated": fa... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, directives
from docutils import nodes
class BaseAdmonition(Directive):
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = True
... | {
"repo_name": "ivan-fedorov/intellij-community",
"path": "python/helpers/docutils/parsers/rst/directives/admonitions.py",
"copies": "51",
"size": "2182",
"license": "apache-2.0",
"hash": 4900746167438148000,
"line_mean": 21.4948453608,
"line_max": 76,
"alpha_frac": 0.6416131989,
"autogenerated": fa... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, directives
from docutils import nodes
class BaseAdmonition(Directive):
required_arguments = 0
optional_arguments = 0
final_argument_wh... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "docutils/parsers/rst/directives/admonitions.py",
"copies": "2",
"size": "2279",
"license": "bsd-3-clause",
"hash": -6029460971646479000,
"line_mean": 21.4948453608,
"line_max": 76,
"alpha_frac": 0.6143045195,
"autogenerated": false,
"ratio": 4.04795... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, directives
from docutils.parsers.rst.roles import set_classes
from docutils import nodes
class BaseAdmonition(Directive):
final_argument_whitespace = True
... | {
"repo_name": "chirilo/remo",
"path": "vendor-local/lib/python/docutils/parsers/rst/directives/admonitions.py",
"copies": "16",
"size": "2273",
"license": "bsd-3-clause",
"hash": -710290248243712000,
"line_mean": 22.6770833333,
"line_max": 76,
"alpha_frac": 0.6410030796,
"autogenerated": false,
"... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, directives
from docutils.parsers.rst.roles import set_classes
from docutils import nodes
class BaseAdmonition(Directive):
final_argument_whites... | {
"repo_name": "ajaxsys/dict-admin",
"path": "docutils/parsers/rst/directives/admonitions.py",
"copies": "2",
"size": "2369",
"license": "bsd-3-clause",
"hash": -5186080294969893000,
"line_mean": 22.6770833333,
"line_max": 76,
"alpha_frac": 0.6150274377,
"autogenerated": false,
"ratio": 4.02891156... |
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
class BaseAdmonition(Directive):
final_argument_whitespace = True
option_sp... | {
"repo_name": "signed/intellij-community",
"path": "python/helpers/py3only/docutils/parsers/rst/directives/admonitions.py",
"copies": "44",
"size": "2404",
"license": "apache-2.0",
"hash": -2864561348624824300,
"line_mean": 23.5306122449,
"line_max": 76,
"alpha_frac": 0.6335274542,
"autogenerated":... |
# $Id: ah.py 34 2007-01-28 07:54:20Z dugsong $
# -*- coding: utf-8 -*-
"""Authentication Header."""
from __future__ import absolute_import
from . import dpkt
class AH(dpkt.Packet):
"""Authentication Header.
TODO: Longer class information....
Attributes:
__hdr__: Header fields of AH.
au... | {
"repo_name": "smutt/dpkt",
"path": "dpkt/ah.py",
"copies": "3",
"size": "1131",
"license": "bsd-3-clause",
"hash": -7692888085102468000,
"line_mean": 23.5869565217,
"line_max": 74,
"alpha_frac": 0.5207780725,
"autogenerated": false,
"ratio": 3.3461538461538463,
"config_test": false,
"has_no_... |
# $Id: aim.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""AOL Instant Messenger."""
import dpkt
import struct
# OSCAR: http://iserverd1.khstu.ru/oscar/
class FLAP(dpkt.Packet):
__hdr__ = (
('ast', 'B', 0x2a), # '*'
('type', 'B', 0),
('seq', 'H', 0),
('len', 'H'... | {
"repo_name": "lkash/test",
"path": "dpkt/aim.py",
"copies": "6",
"size": "1128",
"license": "bsd-3-clause",
"hash": -4040564666547426000,
"line_mean": 20.6923076923,
"line_max": 82,
"alpha_frac": 0.5044326241,
"autogenerated": false,
"ratio": 2.6985645933014353,
"config_test": false,
"has_no... |
# $Id: aim.py 23 2006-11-08 15:45:33Z dugsong $
"""AOL Instant Messenger."""
import dpkt
import struct
# OSCAR: http://iserverd1.khstu.ru/oscar/
class FLAP(dpkt.Packet):
__hdr__ = (
('ast', 'B', 0x2a), # '*'
('type', 'B', 0),
('seq', 'H', 0),
('len', 'H', 0)
)
def unpack(... | {
"repo_name": "openhardnudd/QMarkdowner",
"path": "dpkt/aim.py",
"copies": "15",
"size": "1099",
"license": "mit",
"hash": -344682316206020540,
"line_mean": 22.3829787234,
"line_max": 82,
"alpha_frac": 0.508644222,
"autogenerated": false,
"ratio": 2.6739659367396595,
"config_test": false,
"ha... |
from __future__ import print_function
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit import Geometry
def AlignDepict(mol,core,corePattern=None,acceptFailure=False):
"""
Arguments:
- mol: the molecule to be aligned, this will come back
with a single conformer.
... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/Chem/ChemUtils/AlignDepict.py",
"copies": "4",
"size": "2682",
"license": "bsd-3-clause",
"hash": -706042912084674300,
"line_mean": 26.9375,
"line_max": 103,
"alpha_frac": 0.6510067114,
"autogenerated": false,
"ratio": 3.2747252747252746,
"config_tes... |
from __future__ import print_function
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit import Geometry
def AlignDepict(mol, core, corePattern=None, acceptFailure=False):
"""
Arguments:
- mol: the molecule to be aligned, this will come back
with a single conform... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/Chem/ChemUtils/AlignDepict.py",
"copies": "1",
"size": "2717",
"license": "bsd-3-clause",
"hash": -4428389248506454500,
"line_mean": 27.3020833333,
"line_max": 93,
"alpha_frac": 0.6426205374,
"autogenerated": false,
"ratio": 3.301336573511543,
"confi... |
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit import Geometry
def AlignDepict(mol,core,corePattern=None,acceptFailure=False):
"""
Arguments:
- mol: the molecule to be aligned, this will come back
with a single conformer.
- core: a molecule with th... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/Chem/ChemUtils/AlignDepict.py",
"copies": "2",
"size": "2633",
"license": "bsd-3-clause",
"hash": -1663847178255756000,
"line_mean": 26.7157894737,
"line_max": 102,
"alpha_frac": 0.6490695025,
"autogenerated": false,
"ratio": 3.26270136307311,
"c... |
"""A widget which controls the alignment of its child."""
from Bin import Bin
from Constants import *
import base
class Alignment (Bin):
"""Alignment (width, height) -> Alignment
A Bin widget class which controls the alignment of its child.
The Alignment widget allows its child to be aligned at its edg... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Alignment.py",
"copies": "1",
"size": "4643",
"license": "bsd-2-clause",
"hash": 6918360537415412000,
"line_mean": 34.992248062,
"line_max": 78,
"alpha_frac": 0.6515184148,
"autogenerated": false,
"ratio": 4.2247497725204735,
"config_test... |
""" AMQP based Event Bus plugin based on the QPID library. """
from peloton.plugins import PelotonPlugin
from peloton.events import AbstractEventBusPlugin
from peloton.events import AbstractEventHandler
from peloton.exceptions import MessagingError
from peloton.exceptions import ConfigurationError
from twisted.intern... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/plugins/amqpQpid.py",
"copies": "1",
"size": "8542",
"license": "bsd-3-clause",
"hash": 4001911569498086400,
"line_mean": 39.4834123223,
"line_max": 124,
"alpha_frac": 0.6023179583,
"autogenerated": false,
"ratio": 4.1607403799318075,
"conf... |
"""$Id: application_test.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 Pilgri... | {
"repo_name": "stone5495/NewsBlur",
"path": "vendor/feedvalidator/formatter/application_test.py",
"copies": "16",
"size": "1034",
"license": "mit",
"hash": -3366803700111865000,
"line_mean": 35.9285714286,
"line_max": 94,
"alpha_frac": 0.6731141199,
"autogenerated": false,
"ratio": 3.435215946843... |
# $Id: arp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Address Resolution Protocol."""
from __future__ import absolute_import
from . import dpkt
# Hardware address format
ARP_HRD_ETH = 0x0001 # ethernet hardware
ARP_HRD_IEEE802 = 0x0006 # IEEE 802 hardware
# Protocol address format
ARP_PRO_IP =... | {
"repo_name": "smutt/dpkt",
"path": "dpkt/arp.py",
"copies": "3",
"size": "1143",
"license": "bsd-3-clause",
"hash": 179643461044020160,
"line_mean": 26.2142857143,
"line_max": 61,
"alpha_frac": 0.5870516185,
"autogenerated": false,
"ratio": 3.1487603305785123,
"config_test": false,
"has_no_k... |
# $Id: asn1.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Abstract Syntax Notation #1."""
from __future__ import absolute_import
from __future__ import print_function
import struct
import time
from . import dpkt
from .compat import compat_ord
# Type class
CLASSMASK = 0xc0
UNIVERSAL = 0x00
APPLICATI... | {
"repo_name": "dimagol/trex-core",
"path": "scripts/external_libs/dpkt-1.9.1/dpkt/asn1.py",
"copies": "3",
"size": "5434",
"license": "apache-2.0",
"hash": 8840830073447924000,
"line_mean": 36.2191780822,
"line_max": 976,
"alpha_frac": 0.5794994479,
"autogenerated": false,
"ratio": 2.890425531914... |
# $Id: asn1.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Abstract Syntax Notation #1."""
import struct
import time
import dpkt
# Type class
CLASSMASK = 0xc0
UNIVERSAL = 0x00
APPLICATION = 0x40
CONTEXT = 0x80
PRIVATE = 0xc0
# Constructed (vs. primitive)
CONSTRUCTED = 0x20
# Universal-class tags
TA... | {
"repo_name": "jameslittle/dpkt",
"path": "dpkt/asn1.py",
"copies": "6",
"size": "4886",
"license": "bsd-3-clause",
"hash": 7953910655257532000,
"line_mean": 39.3884297521,
"line_max": 937,
"alpha_frac": 0.5681539091,
"autogenerated": false,
"ratio": 2.8589818607372735,
"config_test": false,
... |
# $Id: asn1.py 23 2006-11-08 15:45:33Z dugsong $
"""Abstract Syntax Notation #1."""
import struct, time
import dpkt
# Type class
CLASSMASK = 0xc0
UNIVERSAL = 0x00
APPLICATION = 0x40
CONTEXT = 0x80
PRIVATE = 0xc0
# Constructed (vs. primitive)
CONSTRUCTED = 0x20
# Universal-class tags
TAGMASK ... | {
"repo_name": "jacklee0810/QMarkdowner",
"path": "dpkt/asn1.py",
"copies": "15",
"size": "4995",
"license": "mit",
"hash": 7053437734507659000,
"line_mean": 40.974789916,
"line_max": 953,
"alpha_frac": 0.5611611612,
"autogenerated": false,
"ratio": 2.8973317865429236,
"config_test": true,
"ha... |
# $Id: asn1.py 271 2006-01-11 16:03:33Z dugsong $
"""Abstract Syntax Notation #1."""
import struct, time
import dpkt
# Type class
CLASSMASK = 0xc0
UNIVERSAL = 0x00
APPLICATION = 0x40
CONTEXT = 0x80
PRIVATE = 0xc0
# Constructed (vs. primitive)
CONSTRUCTED = 0x20
# Universal-class tags
TAGMASK ... | {
"repo_name": "MercenaryLogic/StompingGround",
"path": "stompingground/dpkt/asn1.py",
"copies": "1",
"size": "4996",
"license": "mit",
"hash": -6388156514376681000,
"line_mean": 40.9831932773,
"line_max": 953,
"alpha_frac": 0.5612489992,
"autogenerated": false,
"ratio": 2.896231884057971,
"conf... |
# $Id: AtlasUtil.py 153446 2015-02-22 16:28:34Z xju $
#
# Module providing some convenience functions for decorating ATLAS plots.
#
##
# @short Function producing the "ATLAS Preliminary" sign
#
# There is a usual format for the "ATLAS Preliminary" sign on the plots,
# this function takes care of using that. Plus, it m... | {
"repo_name": "xju2/monojet",
"path": "scripts/AtlasUtil.py",
"copies": "1",
"size": "4336",
"license": "mit",
"hash": -3696687701166592000,
"line_mean": 37.7142857143,
"line_max": 122,
"alpha_frac": 0.6409132841,
"autogenerated": false,
"ratio": 2.9516678012253235,
"config_test": false,
"has... |
"""$Id: author.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 b... | {
"repo_name": "Einsteinish/PyTune3",
"path": "vendor/feedvalidator/author.py",
"copies": "16",
"size": "1386",
"license": "mit",
"hash": -925066896212175900,
"line_mean": 25.1509433962,
"line_max": 94,
"alpha_frac": 0.6630591631,
"autogenerated": false,
"ratio": 3.10762331838565,
"config_test":... |
"""Basic object class, used as abstract class definition for event
capable objects."""
from ocempgui.events import EventManager, EventCallback, INotifyable
class BaseObject (INotifyable):
"""BaseObject () -> BaseObject
An object class, which is able to receive events.
The BaseObject provides a basic se... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/object/BaseObject.py",
"copies": "1",
"size": "7111",
"license": "bsd-2-clause",
"hash": -2290178485999679700,
"line_mean": 39.4034090909,
"line_max": 78,
"alpha_frac": 0.6717761215,
"autogenerated": false,
"ratio": 4.617532467532468,
"config_tes... |
""" Base classes for, e.g., Kernels and Workers
@todo: Check to see if we need to reset sys.ext and set
handlers every time - it is most likely that these
mods are preserved in the fork so shouldn't need to
be done in any extension of HandlerBase.
"""
import sys
import peloton.utils.logging as l... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/base.py",
"copies": "1",
"size": "2386",
"license": "bsd-3-clause",
"hash": 6860580205269928000,
"line_mean": 36.8888888889,
"line_max": 85,
"alpha_frac": 0.6504610226,
"autogenerated": false,
"ratio": 4.1280276816609,
"config_test": false,... |
"""$Id: base.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"
"""Base ... | {
"repo_name": "nriley/NewsBlur",
"path": "vendor/feedvalidator/formatter/base.py",
"copies": "16",
"size": "2249",
"license": "mit",
"hash": -1223273077245527000,
"line_mean": 32.5671641791,
"line_max": 94,
"alpha_frac": 0.6496220542,
"autogenerated": false,
"ratio": 3.4493865030674846,
"config... |
"""$Id: base.py 744 2007-03-24 11:57:16Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 744 $"
__date__ = "$Date: 2007-03-24 11:57:16 +0000 (Sat, 24 Mar 2007) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from xml... | {
"repo_name": "epiphany27/NewsBlur",
"path": "vendor/feedvalidator/base.py",
"copies": "16",
"size": "19402",
"license": "mit",
"hash": -8884613260529229000,
"line_mean": 36.9686888454,
"line_max": 161,
"alpha_frac": 0.6388001237,
"autogenerated": false,
"ratio": 3.509768451519537,
"config_test... |
"""Globally used variables and objects by the widgets."""
from pygame import init as pygameinit, key
from Style import Style
from StyleInformation import StyleInformation
# Globally used style object for the widgets.
GlobalStyle = None
# Timer rate in ms to adjust the double-click speed.
DoubleClickRate = 0
def in... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/base.py",
"copies": "1",
"size": "2710",
"license": "bsd-2-clause",
"hash": 1223751144590743000,
"line_mean": 37.7142857143,
"line_max": 78,
"alpha_frac": 0.7431734317,
"autogenerated": false,
"ratio": 4.329073482428115,
"config_test": fa... |
"""Basic widget class, used as an abstract definition for widgets."""
# TODO: Add ControlCollection class to the components.
from pygame import sprite, Rect, Surface
from pygame import error as PygameError
from ocempgui.object import BaseObject
from ocempgui.access import IIndexable
from Style import WidgetStyle
fro... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/BaseWidget.py",
"copies": "1",
"size": "36876",
"license": "bsd-2-clause",
"hash": -1229466538969074200,
"line_mean": 36.5519348269,
"line_max": 78,
"alpha_frac": 0.6052174856,
"autogenerated": false,
"ratio": 4.498719043552519,
"config_t... |
# $Id: benchmark.py 1757 2004-03-28 17:21:25Z fredrik $
# simple elementtree benchmark program
from elementtree import XMLTreeBuilder, SimpleXMLTreeBuilder
from elementtree import SgmlopXMLTreeBuilder
from xml.dom import minidom
import sys, time
try:
file = sys.argv[1]
except IndexError:
file = "hamlet.xml"
... | {
"repo_name": "yongshengwang/builthue",
"path": "desktop/core/ext-py/elementtree/benchmark.py",
"copies": "45",
"size": "1259",
"license": "apache-2.0",
"hash": 7933153415694996000,
"line_mean": 26.3695652174,
"line_max": 63,
"alpha_frac": 0.6648133439,
"autogenerated": false,
"ratio": 3.46831955... |
# $Id: benchmark.py 2923 2006-11-19 08:05:45Z fredrik $
# simple elementtree benchmark program
from elementtree import ElementTree, XMLTreeBuilder
try:
import cElementTree
except ImportError:
try:
from xml.etree import cElementTree
except ImportError:
cElementTree = None
try:
... | {
"repo_name": "prats226/python-amazon-product-api-0.2.8",
"path": "tests/build/elementtree/benchmark.py",
"copies": "5",
"size": "2170",
"license": "bsd-3-clause",
"hash": -8944662118714484000,
"line_mean": 25.4683544304,
"line_max": 67,
"alpha_frac": 0.6382488479,
"autogenerated": false,
"ratio"... |
# $Id: bgp.py 52 2008-08-25 22:22:34Z jon.oberheide $
"""Border Gateway Protocol."""
import dpkt
import struct, socket
# Border Gateway Protocol 4 - RFC 4271
# Communities Attribute - RFC 1997
# Capabilities - RFC 3392
# Route Refresh - RFC 2918
# Route Reflection - RFC 4456
# Confederations - RFC 3065
# Cease Subco... | {
"repo_name": "guke001/QMarkdowner",
"path": "dpkt/bgp.py",
"copies": "10",
"size": "25737",
"license": "mit",
"hash": 5537722251092449000,
"line_mean": 32.8644736842,
"line_max": 501,
"alpha_frac": 0.4523448731,
"autogenerated": false,
"ratio": 3.549931034482759,
"config_test": false,
"has_n... |
# $Id: bgp.py 76 2011-01-06 15:51:30Z dugsong $
# -*- coding: utf-8 -*-
"""Border Gateway Protocol."""
from __future__ import print_function
from __future__ import absolute_import
import struct
import socket
from . import dpkt
from .decorators import deprecated
# Border Gateway Protocol 4 - RFC 4271
# Communities A... | {
"repo_name": "smutt/dpkt",
"path": "dpkt/bgp.py",
"copies": "3",
"size": "24436",
"license": "bsd-3-clause",
"hash": -375874084797032000,
"line_mean": 30.8591916558,
"line_max": 496,
"alpha_frac": 0.4681208054,
"autogenerated": false,
"ratio": 3.5003581148832548,
"config_test": false,
"has_n... |
# $Id: bgp.py 76 2011-01-06 15:51:30Z dugsong $
# -*- coding: utf-8 -*-
"""Border Gateway Protocol."""
import struct
import socket
import dpkt
from decorators import deprecated
# Border Gateway Protocol 4 - RFC 4271
# Communities Attribute - RFC 1997
# Capabilities - RFC 3392
# Route Refresh - RFC 2918
# Route Refle... | {
"repo_name": "jack8daniels2/dpkt",
"path": "dpkt/bgp.py",
"copies": "1",
"size": "27596",
"license": "bsd-3-clause",
"hash": -5448426694056687000,
"line_mean": 31.5041224971,
"line_max": 495,
"alpha_frac": 0.4509711552,
"autogenerated": false,
"ratio": 3.628188272416513,
"config_test": false,
... |
# $Id: bgp.py 76 2011-01-06 15:51:30Z dugsong $
"""Border Gateway Protocol."""
import dpkt
import struct, socket
# Border Gateway Protocol 4 - RFC 4271
# Communities Attribute - RFC 1997
# Capabilities - RFC 3392
# Route Refresh - RFC 2918
# Route Reflection - RFC 4456
# Confederations - RFC 3065
# Cease Subcodes - ... | {
"repo_name": "pquerna/tls-client-hello-stats",
"path": "third_party/dpkt/dpkt/bgp.py",
"copies": "5",
"size": "25731",
"license": "apache-2.0",
"hash": 2295317537831036200,
"line_mean": 32.8565789474,
"line_max": 501,
"alpha_frac": 0.4522560336,
"autogenerated": false,
"ratio": 3.551062655258073... |
"""
This is a mod to make all the Twisted threads daemon threads
so that they do not block termination of the main process.
Even when threads are daemonised, when the reactor calls threadpool.stop()it
attempts to join() every thread and close it. If threads are blocked for
some reason this call will also block.
So ... | {
"repo_name": "aquamatt/Peloton",
"path": "src/peloton/utils/bigThreadPool.py",
"copies": "1",
"size": "3858",
"license": "bsd-3-clause",
"hash": 304122233344019650,
"line_mean": 35.7523809524,
"line_max": 86,
"alpha_frac": 0.6591498186,
"autogenerated": false,
"ratio": 3.940755873340143,
"conf... |
"""An abstract widget, which can hold exactly one other widget."""
from BaseWidget import BaseWidget
class Bin (BaseWidget):
"""Bin () -> Bin
A container widget class, which can hold one other widget.
The Bin widget class is an abstract class, which can hold exactly
one other widget. It is usable t... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Bin.py",
"copies": "1",
"size": "7346",
"license": "bsd-2-clause",
"hash": -1910476699253050000,
"line_mean": 33.6509433962,
"line_max": 78,
"alpha_frac": 0.6214266267,
"autogenerated": false,
"ratio": 4.492966360856269,
"config_test": fa... |
# $Id: BMPRDR.py 1853 2006-02-01 17:16:28Z cpbotha $
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import wx
class BMPReader(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, mo... | {
"repo_name": "nagyistoce/devide",
"path": "modules/readers/BMPReader.py",
"copies": "7",
"size": "3607",
"license": "bsd-3-clause",
"hash": 4661768936220958000,
"line_mean": 34.7128712871,
"line_max": 74,
"alpha_frac": 0.5885777655,
"autogenerated": false,
"ratio": 3.9944629014396456,
"config_... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
... | {
"repo_name": "PatrickKennedy/Sybil",
"path": "docutils/parsers/rst/directives/body.py",
"copies": "2",
"size": "5778",
"license": "bsd-2-clause",
"hash": 8997563756861494000,
"line_mean": 29.09375,
"line_max": 78,
"alpha_frac": 0.6161301488,
"autogenerated": false,
"ratio": 3.9548254620123204,
... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
class Base... | {
"repo_name": "MER-GROUP/intellij-community",
"path": "python/helpers/py2only/docutils/parsers/rst/directives/body.py",
"copies": "5",
"size": "5759",
"license": "apache-2.0",
"hash": -7099028375942207000,
"line_mean": 29.3105263158,
"line_max": 78,
"alpha_frac": 0.6157318979,
"autogenerated": fals... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
... | {
"repo_name": "orekyuu/intellij-community",
"path": "python/helpers/docutils/parsers/rst/directives/body.py",
"copies": "51",
"size": "5771",
"license": "apache-2.0",
"hash": 5403713989357063000,
"line_mean": 29.0572916667,
"line_max": 78,
"alpha_frac": 0.6160110899,
"autogenerated": false,
"rati... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles impor... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "docutils/parsers/rst/directives/body.py",
"copies": "2",
"size": "5963",
"license": "bsd-3-clause",
"hash": -932805525182199800,
"line_mean": 29.0572916667,
"line_max": 78,
"alpha_frac": 0.5961764213,
"autogenerated": false,
"ratio": 4.0592239618788... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
... | {
"repo_name": "paaschpa/badcomputering",
"path": "docutils/parsers/rst/directives/body.py",
"copies": "6",
"size": "6978",
"license": "bsd-3-clause",
"hash": -2293969529767857700,
"line_mean": 29.7400881057,
"line_max": 78,
"alpha_frac": 0.599885354,
"autogenerated": false,
"ratio": 4.00114678899... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles impor... | {
"repo_name": "ajaxsys/dict-admin",
"path": "docutils/parsers/rst/directives/body.py",
"copies": "2",
"size": "7205",
"license": "bsd-3-clause",
"hash": -4755607485531948000,
"line_mean": 29.7400881057,
"line_max": 78,
"alpha_frac": 0.5809854268,
"autogenerated": false,
"ratio": 4.086783891094725... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
from docutil... | {
"repo_name": "mdaniel/intellij-community",
"path": "python/helpers/py3only/docutils/parsers/rst/directives/body.py",
"copies": "44",
"size": "9232",
"license": "apache-2.0",
"hash": 4638055173871111000,
"line_mean": 31.1672473868,
"line_max": 79,
"alpha_frac": 0.593262565,
"autogenerated": false,
... |
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
... | {
"repo_name": "xfournet/intellij-community",
"path": "python/helpers/py2only/docutils/parsers/rst/directives/body.py",
"copies": "128",
"size": "9243",
"license": "apache-2.0",
"hash": 368462770430755200,
"line_mean": 30.9826989619,
"line_max": 79,
"alpha_frac": 0.5934220491,
"autogenerated": false... |
# Boost library support module.
#
# This module allows to use the boost library from boost-build projects.
# The location of a boost source tree or the path to a pre-built
# version of the library can be configured from either site-config.jam
# or user-config.jam. If no location is configured the module looks ... | {
"repo_name": "flingone/frameworks_base_cmds_remoted",
"path": "libs/boost/tools/build/src/contrib/boost.py",
"copies": "2",
"size": "11493",
"license": "apache-2.0",
"hash": -8273881732779942000,
"line_mean": 39.1935483871,
"line_max": 133,
"alpha_frac": 0.5923605673,
"autogenerated": false,
"ra... |
"""An abstract widget for button type widget implementations."""
from pygame import time as PygameTime
from pygame import K_SPACE, K_KP_ENTER, K_RETURN
from Bin import Bin
from Constants import *
import base
class ButtonBase (Bin):
"""
ButtonBase () -> ButtonBase
An abstract base class that implements b... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/ButtonBase.py",
"copies": "1",
"size": "6588",
"license": "bsd-2-clause",
"hash": 1115756313914449900,
"line_mean": 38.686746988,
"line_max": 78,
"alpha_frac": 0.5925925926,
"autogenerated": false,
"ratio": 4.6199158485273495,
"config_tes... |
"""A widget, which acts upon different mouse events."""
from ButtonBase import ButtonBase
from Label import Label
from Constants import *
import base
class Button (ButtonBase):
"""Button (text=None) -> Button ()
A widget class, which can react upon mouse events.
The Button widget can listen to mouse ev... | {
"repo_name": "prim/ocempgui",
"path": "ocempgui/widgets/Button.py",
"copies": "1",
"size": "6750",
"license": "bsd-2-clause",
"hash": -4605172156315822600,
"line_mean": 34.7142857143,
"line_max": 78,
"alpha_frac": 0.6377777778,
"autogenerated": false,
"ratio": 4.383116883116883,
"config_test":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.