text stringlengths 0 1.05M | meta dict |
|---|---|
"""
Utilities for running jython performance tests.
"""
from dapbench.jython.netcdf import Dataset
import subprocess as S
import os, signal
def partition_shape(shape, partitions):
"""
Yields slices of an array described by <shape> that split into Nx-parts
allong each axis where partions = (N0, N1, N2, .... | {
"repo_name": "cedadev/dapbench",
"path": "dapbench/jython/util.py",
"copies": "1",
"size": "3916",
"license": "bsd-3-clause",
"hash": 5066768792045012000,
"line_mean": 24.4285714286,
"line_max": 80,
"alpha_frac": 0.575587334,
"autogenerated": false,
"ratio": 3.873392680514342,
"config_test": f... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# # Analysis of CMIP5 archive snapshot 2013-02-19
#
# Author: Stephen Pascoe
#
# By directly querying the SOLr shards at http://esgf-index1.ceda.ac.uk I have extracted summary information for every dataset version in the CMIP5 archive.
# <codecel... | {
"repo_name": "stephenpascoe/esgf-analytics",
"path": "notebook2.py",
"copies": "1",
"size": "3553",
"license": "bsd-3-clause",
"hash": 3213596963100365300,
"line_mean": 26.7578125,
"line_max": 156,
"alpha_frac": 0.6456515621,
"autogenerated": false,
"ratio": 2.8333333333333335,
"config_test": ... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# # Analysis of replicated CMIP5 datasets on 2013-02-06
# **Author**: [Stephen Pascoe](Stephen.Pascoe@stfc.ac.uk)
#
# This notebook describes the analysis of a snapshot of all replicas in the CMIP5 archive on February 6th 2013. A list of all datas... | {
"repo_name": "stephenpascoe/esgf-analytics",
"path": "replicas.py",
"copies": "1",
"size": "8918",
"license": "bsd-3-clause",
"hash": 5291067812850227000,
"line_mean": 31.7867647059,
"line_max": 281,
"alpha_frac": 0.6209912536,
"autogenerated": false,
"ratio": 3.5124064592359194,
"config_test"... |
# BSD-licensed code used here:
# https://github.com/coleifer/djangosnippets.org/blob/master/cab/templatetags/core_tags.py
from django.db.models.loading import get_model
from django.db.models.query import QuerySet
from django.db.models.fields import DateTimeField, DateField
from django import template
from scipy_centra... | {
"repo_name": "oswalpalash/OctaveCodeShare",
"path": "scipy_central/submission/templatetags/core_tags.py",
"copies": "1",
"size": "4243",
"license": "bsd-3-clause",
"hash": -8849512623119536000,
"line_mean": 30.6641791045,
"line_max": 90,
"alpha_frac": 0.6438840443,
"autogenerated": false,
"ratio... |
from TileCache.Cache import Cache
import time
class AWSS3(Cache):
import_error = "Problem importing S3 support library. You must have either boto or the Amazon S3 library.\nErrors:\n * %s"
def __init__ (self, access_key, secret_access_key, use_tms_paths = "False", **kwargs):
self.module = None
... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "publicoldtestsite/cgi/tilecache/TileCache/Caches/AWSS3.py",
"copies": "7",
"size": "6408",
"license": "mit",
"hash": 2409404862771050500,
"line_mean": 34.4033149171,
"line_max": 126,
"alpha_frac": 0.5308988764,
"autogenerated": false,
"ratio": 3.740805... |
import os, sys, time
from warnings import warn
class Cache (object):
def __init__ (self, timeout = 30.0, stale_interval = 300.0, readonly = False, **kwargs):
self.stale = float(stale_interval)
self.timeout = float(timeout)
self.readonly = readonly
def lock (self, til... | {
"repo_name": "trailbehind/Gaia-Map-Warper",
"path": "public/cgi/tilecache/TileCache/Cache.py",
"copies": "7",
"size": "1366",
"license": "mit",
"hash": -3631328456767816000,
"line_mean": 30.0454545455,
"line_max": 136,
"alpha_frac": 0.5966325037,
"autogenerated": false,
"ratio": 4.28213166144200... |
from Swarm import Message, Client
from twisted.internet.protocol import DatagramProtocol
from twisted.web import getPage
from twisted.internet import reactor
class TwistedClient (DatagramProtocol, Client):
directoryURL = "..."
def __init__ (self, service, key, weight = 10.0, *args, **kwargs):
Datagra... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "public/cgi/tilecache/TileCache/Peer/Twisted.py",
"copies": "7",
"size": "1084",
"license": "mit",
"hash": -2270812406736124200,
"line_mean": 29.9714285714,
"line_max": 70,
"alpha_frac": 0.6466789668,
"autogenerated": false,
"ratio": 3.6498316498316496,... |
from TileCache.Cache import Cache
import sys, os, time, warnings
class Disk (Cache):
def __init__ (self, base = None, umask = '002', **kwargs):
Cache.__init__(self, **kwargs)
self.basedir = base
self.umask = int(umask, 0)
if sys.platform.startswith("java"):
fro... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "public/cgi/tilecache/TileCache/Caches/Disk.py",
"copies": "7",
"size": "4105",
"license": "mit",
"hash": -8199008424203172000,
"line_mean": 32.3739837398,
"line_max": 78,
"alpha_frac": 0.490864799,
"autogenerated": false,
"ratio": 4.125628140703518,
... |
from TileCache.Cache import Cache
import time
class Memcached(Cache):
def __init__ (self, servers = ['127.0.0.1:11211'], **kwargs):
Cache.__init__(self, **kwargs)
import memcache
if type(servers) is str: servers = map(str.strip, servers.split(","))
raise Exception(servers)
... | {
"repo_name": "l34marr/mapwarper",
"path": "public/cgi/tilecache/TileCache/Caches/Memcached.py",
"copies": "7",
"size": "1163",
"license": "mit",
"hash": -1555487015155551000,
"line_mean": 28.8205128205,
"line_max": 77,
"alpha_frac": 0.5769561479,
"autogenerated": false,
"ratio": 3.55657492354740... |
from TileCache.Layer import MetaLayer
import osgeo.gdal as gdal
import osgeo.gdal_array as gdalarray
import numpy
import PIL
class GDAL(MetaLayer):
"""
The GDAL Layer allows you to set up any GDAL datasource in TileCache.
Areas not covered by the image will be transparent in formats which
support tra... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "public/cgi/tilecache/TileCache/Layers/GDAL.py",
"copies": "7",
"size": "5594",
"license": "mit",
"hash": 793684427886931300,
"line_mean": 41.0601503759,
"line_max": 148,
"alpha_frac": 0.5500536289,
"autogenerated": false,
"ratio": 3.5607893061744114,
... |
from TileCache.Layer import MetaLayer
import TileCache.Client as WMSClient
class WMS(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
{'name':'url', 'description': 'URL of Remote Layer'},
{'name':'user', 'description': 'Username of remote server: used for basic... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "publicoldtestsite/cgi/tilecache/TileCache/Layers/WMS.py",
"copies": "7",
"size": "1171",
"license": "mit",
"hash": -2635447351245511000,
"line_mean": 38.0333333333,
"line_max": 120,
"alpha_frac": 0.5960717336,
"autogenerated": false,
"ratio": 3.7652733... |
from TileCache.Layer import MetaLayer
class Image(MetaLayer):
"""The ImageLayer allows you to set up any image file in TileCache.
All you need is an image, and a geographic bounds (filebounds),
Which is passed in as a single, comma seperated string in the form
minx,miny,maxx,maxy."""
... | {
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"path": "public/cgi/tilecache/TileCache/Layers/Image.py",
"copies": "7",
"size": "3042",
"license": "mit",
"hash": 8303960531072756000,
"line_mean": 41.8450704225,
"line_max": 96,
"alpha_frac": 0.5762656147,
"autogenerated": false,
... |
from TileCache.Layer import MetaLayer
class MapServer(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
{'name':'mapfile', 'description': 'Location of MapServer map file.'},
] + MetaLayer.config_properties
def __init__ (self, name, mapfile = None, ... | {
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"path": "public/cgi/tilecache/TileCache/Layers/MapServer.py",
"copies": "7",
"size": "2114",
"license": "mit",
"hash": -8113684652516390000,
"line_mean": 38.8867924528,
"line_max": 78,
"alpha_frac": 0.6026490066,
"autogenerated": fa... |
from TileCache.Service import Request, Capabilities
from TileCache.Services.TMS import TMS
import TileCache.Layer as Layer
class KML(TMS):
def parse (self, fields, path, host):
tile = TMS.parse(self,fields, path, host)
kml = self.generate_kml_doc(tile, base_path=host)
return ("application... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "public/cgi/tilecache/TileCache/Services/KML.py",
"copies": "7",
"size": "2806",
"license": "mit",
"hash": -234083866676071840,
"line_mean": 34.075,
"line_max": 161,
"alpha_frac": 0.5288667142,
"autogenerated": false,
"ratio": 3.023706896551724,
"conf... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class TMS (Request):
def parse (self, fields, path, host):
# /1.0.0/global_mosaic/0/0/0.jpg
parts = filter( lambda x: x != "", path.split("/") )
if not host[-1] == "/": host = host + "/"
if len(par... | {
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"path": "publicoldtestsite/cgi/tilecache/TileCache/Services/TMS.py",
"copies": "7",
"size": "3670",
"license": "mit",
"hash": 748715153335415400,
"line_mean": 38.8913043478,
"line_max": 106,
"alpha_frac": 0.4640326975,
"autogenerate... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class VETMS (Request):
"""
Support for Virtual Earth quadkey-based URLs.
<host>?ve=true&layer=global_mosaic&tile=000.jpg
"""
def parse (self, fields, path, host):
"""Take in VETMS params and return a ti... | {
"repo_name": "l34marr/mapwarper",
"path": "public/cgi/tilecache/TileCache/Services/VETMS.py",
"copies": "7",
"size": "1899",
"license": "mit",
"hash": -5390903710095238000,
"line_mean": 29.6290322581,
"line_max": 82,
"alpha_frac": 0.4834123223,
"autogenerated": false,
"ratio": 3.569548872180451,... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class WMS (Request):
def parse (self, fields, path, host):
param = {}
for key in ['bbox', 'layers', 'request', 'version']:
if fields.has_key(key.upper()):
param[key] = fields[key.upper(... | {
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"path": "publicoldtestsite/cgi/tilecache/TileCache/Services/WMS.py",
"copies": "7",
"size": "5322",
"license": "mit",
"hash": -3316184198954112500,
"line_mean": 34.9594594595,
"line_max": 107,
"alpha_frac": 0.4573468621,
"autogenera... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class WorldWind (Request):
def parse (self, fields, path, host):
param = {}
for key in ['t', 'l', 'x', 'y', 'request']:
if fields.has_key(key.upper()):
param[key] = fields[key.upper()]... | {
"repo_name": "DOE-NEPA/mapwarper",
"path": "public/cgi/tilecache/TileCache/Services/WorldWind.py",
"copies": "7",
"size": "3495",
"license": "mit",
"hash": 2899848877898726000,
"line_mean": 37.8333333333,
"line_max": 105,
"alpha_frac": 0.5021459227,
"autogenerated": false,
"ratio": 4.35242839352... |
from TileCache.Service import Request, Capabilities, TileCacheException
import TileCache.Layer as Layer
class WMTS (Request):
meters_per_unit = { 'degrees': 111118.752,
'meters': 1,
'feet': 0.3048
}
def parse (self, fields, path, host):
... | {
"repo_name": "JJediny/mapwarper",
"path": "public/cgi/tilecache/TileCache/Services/WMTS.py",
"copies": "7",
"size": "1220",
"license": "mit",
"hash": 8170429528844510000,
"line_mean": 38.3548387097,
"line_max": 135,
"alpha_frac": 0.5442622951,
"autogenerated": false,
"ratio": 3.7888198757763973,... |
import os, sys
from warnings import warn
from Client import WMS
from Service import TileCacheException
DEBUG = True
class Tile (object):
"""
>>> l = Layer("name", maxresolution=0.019914, size="256,256")
>>> t = Tile(l, 18, 20, 0)
"""
__slots__ = ( "layer", "x", "y", "z", "data" )
def __init__... | {
"repo_name": "JJediny/mapwarper",
"path": "public/cgi/tilecache/TileCache/Layer.py",
"copies": "7",
"size": "17268",
"license": "mit",
"hash": 7108254082843874000,
"line_mean": 35.5847457627,
"line_max": 167,
"alpha_frac": 0.5092077832,
"autogenerated": false,
"ratio": 3.5870378063980057,
"con... |
import struct, time
from sha import sha
from bisect import bisect_left
from Layer import Layer, Tile
from Client import WMS
from Service import Service
class Message (object):
types = ("PING", "PONG", "GET", "PUT", "DELETE")
header = "!20sLHH"
header_len = struct.calcsize(header) ... | {
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"path": "public/cgi/tilecache/TileCache/Swarm.py",
"copies": "7",
"size": "8061",
"license": "mit",
"hash": -6615255331070473000,
"line_mean": 31.5040322581,
"line_max": 78,
"alpha_frac": 0.5454658231,
"autogenerated": false,
"rat... |
import sys
from TileCache.Layer import MetaLayer
class Mapnik(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
{'name':'mapfile', 'description': 'Location of Mapnik XML map description.'},
{'name':'projection', 'description': 'Target map projection.'},
... | {
"repo_name": "JJediny/mapwarper",
"path": "public/cgi/tilecache/TileCache/Layers/Mapnik.py",
"copies": "7",
"size": "3267",
"license": "mit",
"hash": 5770417197170719000,
"line_mean": 36.1363636364,
"line_max": 127,
"alpha_frac": 0.5142332415,
"autogenerated": false,
"ratio": 4.188461538461539,
... |
"""
ArcXML support. This layer will make requests to an ArcIMS server.
"""
from TileCache.Layer import MetaLayer
from TileCache.Service import TileCacheException
import urllib
import xml.dom.minidom as m
class ArcXML(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
... | {
"repo_name": "l34marr/mapwarper",
"path": "public/cgi/tilecache/TileCache/Layers/ArcXML.py",
"copies": "7",
"size": "4830",
"license": "mit",
"hash": -2697978774235953000,
"line_mean": 38.5901639344,
"line_max": 374,
"alpha_frac": 0.5619047619,
"autogenerated": false,
"ratio": 3.530701754385965,... |
from TileCache.Cache import Cache
import time
class AWSS3(Cache):
import_error = "Problem importing S3 support library. You must have either boto or the Amazon S3 library.\nErrors:\n * %s"
def __init__ (self, access_key, secret_access_key, db, use_tms_paths = "False", **kwargs):
self.module = None
... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Caches/AWSS3.py",
"copies": "1",
"size": "6548",
"license": "mit",
"hash": -1579292196676546300,
"line_mean": 34.5869565217,
"line_max": 126,
"alpha_frac": 0.5349725107,
"autogenerated": false,
"ratio": 3.7567412507171545,
"config_... |
import os, sys, time
from warnings import warn
class Cache (object):
def __init__ (self, timeout = 30.0, stale_interval = 300.0, readonly = False, expire = False, sendfile = False, **kwargs):
self.stale = float(stale_interval)
self.timeout = float(timeout)
self.readonly = readonly
... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Cache.py",
"copies": "1",
"size": "1586",
"license": "mit",
"hash": -8134480398160319000,
"line_mean": 32.0416666667,
"line_max": 136,
"alpha_frac": 0.5952080706,
"autogenerated": false,
"ratio": 4.240641711229946,
"config_test": f... |
from Swarm import Message, Client
from twisted.internet.protocol import DatagramProtocol
from twisted.web import getPage
from twisted.internet import reactor
class TwistedClient (DatagramProtocol, Client):
directoryURL = "..."
def __init__ (self, service, key, weight = 10.0, *args, **kwargs):
Datagra... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Peer/Twisted.py",
"copies": "1",
"size": "1091",
"license": "mit",
"hash": -4596127814493678600,
"line_mean": 30.1714285714,
"line_max": 70,
"alpha_frac": 0.6507791017,
"autogenerated": false,
"ratio": 3.698305084745763,
"config_te... |
from TileCache.Cache import Cache
import sys, os, time, warnings
class Disk (Cache):
def __init__ (self, base = None, umask = '002', **kwargs):
Cache.__init__(self, **kwargs)
self.basedir = base
self.umask = int(umask, 0)
if sys.platform.startswith("java"):
from java.io... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Caches/Disk.py",
"copies": "1",
"size": "4263",
"license": "mit",
"hash": 3249080955883252000,
"line_mean": 33.104,
"line_max": 78,
"alpha_frac": 0.4956603331,
"autogenerated": false,
"ratio": 4.134820562560621,
"config_test": fals... |
from TileCache.Cache import Cache
import time
class Memcached(Cache):
def __init__ (self, servers = ['127.0.0.1:11211'], **kwargs):
Cache.__init__(self, **kwargs)
import memcache
if type(servers) is str: servers = map(str.strip, servers.split(","))
self.cache = memcache.Client(serv... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Caches/Memcached.py",
"copies": "1",
"size": "1137",
"license": "mit",
"hash": -2361417244155392000,
"line_mean": 28.9210526316,
"line_max": 77,
"alpha_frac": 0.5795954266,
"autogenerated": false,
"ratio": 3.5642633228840124,
"conf... |
from TileCache.Layer import MetaLayer
import osgeo.gdal as gdal
import osgeo.gdal_array as gdalarray
import numpy
import PIL
class GDAL(MetaLayer):
"""
The GDAL Layer allows you to set up any GDAL datasource in TileCache.
Areas not covered by the image will be transparent in formats which
support tra... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layers/GDAL.py",
"copies": "1",
"size": "5601",
"license": "mit",
"hash": 4861590552850121000,
"line_mean": 41.1127819549,
"line_max": 148,
"alpha_frac": 0.5509730405,
"autogenerated": false,
"ratio": 3.5697896749521987,
"config_te... |
from TileCache.Layer import MetaLayer
class Image(MetaLayer):
"""The ImageLayer allows you to set up any image file in TileCache.
All you need is an image, and a geographic bounds (filebounds),
Which is passed in as a single, comma seperated string in the form
minx,miny,maxx,maxy."""
... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layers/Image.py",
"copies": "1",
"size": "3049",
"license": "mit",
"hash": -6871664743468150000,
"line_mean": 41.9436619718,
"line_max": 96,
"alpha_frac": 0.5778943916,
"autogenerated": false,
"ratio": 3.504597701149425,
"config_te... |
from TileCache.Layer import MetaLayer
class MapServer(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
{'name':'mapfile', 'description': 'Location of MapServer map file.'},
{'name':'expire', 'description': 'Location of MapServer map file.'}
] + MetaLa... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layers/MapServer.py",
"copies": "1",
"size": "2233",
"license": "mit",
"hash": -5500407229792503000,
"line_mean": 39.6,
"line_max": 79,
"alpha_frac": 0.60591133,
"autogenerated": false,
"ratio": 3.9592198581560285,
"config_test": f... |
from TileCache.Service import Request, Capabilities
from TileCache.Services.TMS import TMS
import TileCache.Layer as Layer
class KML(TMS):
def parse (self, fields, path, host):
tile = TMS.parse(self,fields, path, host)
kml = self.generate_kml_doc(tile, base_path=host)
return ("application... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Services/KML.py",
"copies": "1",
"size": "2813",
"license": "mit",
"hash": 269300454565499330,
"line_mean": 34.1625,
"line_max": 161,
"alpha_frac": 0.5307500889,
"autogenerated": false,
"ratio": 3.037796976241901,
"config_test": fa... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class TMS (Request):
def parse (self, fields, path, host):
# /1.0.0/global_mosaic/0/0/0.jpg
parts = filter( lambda x: x != "", path.split("/") )
if not host[-1] == "/": host = host + "/"
if len(par... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Services/TMS.py",
"copies": "1",
"size": "3677",
"license": "mit",
"hash": -8837212514134975000,
"line_mean": 38.9673913043,
"line_max": 106,
"alpha_frac": 0.465596954,
"autogenerated": false,
"ratio": 3.7712820512820513,
"config_t... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class VETMS (Request):
"""
Support for Virtual Earth quadkey-based URLs.
<host>?ve=true&layer=global_mosaic&tile=000.jpg
"""
def parse (self, fields, path, host):
"""Take in VETMS params and return a ti... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Services/VETMS.py",
"copies": "1",
"size": "1906",
"license": "mit",
"hash": 6289909454377671000,
"line_mean": 29.7419354839,
"line_max": 82,
"alpha_frac": 0.4863588667,
"autogenerated": false,
"ratio": 3.5962264150943395,
"config_... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class WMS (Request):
def parse (self, fields, path, host):
param = {}
for key in ['bbox', 'layers', 'request', 'version']:
if fields.has_key(key.upper()):
param[key] = fields[key.upper(... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Services/WMS.py",
"copies": "1",
"size": "5329",
"license": "mit",
"hash": 4034895868507404300,
"line_mean": 35.0067567568,
"line_max": 107,
"alpha_frac": 0.4584349784,
"autogenerated": false,
"ratio": 4.131007751937984,
"config_te... |
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class WorldWind (Request):
def parse (self, fields, path, host):
param = {}
for key in ['t', 'l', 'x', 'y', 'request']:
if fields.has_key(key.upper()):
param[key] = fields[key.upper()]... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Services/WorldWind.py",
"copies": "1",
"size": "3502",
"license": "mit",
"hash": -8628589249866956000,
"line_mean": 37.9111111111,
"line_max": 105,
"alpha_frac": 0.5037121645,
"autogenerated": false,
"ratio": 4.372034956304619,
"co... |
from TileCache.Service import Request, Capabilities, TileCacheException
import TileCache.Layer as Layer
class WMTS (Request):
meters_per_unit = { 'degrees': 111118.752,
'meters': 1,
'feet': 0.3048
}
def parse (self, fields, path, host):
... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Services/WMTS.py",
"copies": "1",
"size": "1227",
"license": "mit",
"hash": 8148000459887802000,
"line_mean": 38.5806451613,
"line_max": 135,
"alpha_frac": 0.5484922575,
"autogenerated": false,
"ratio": 3.834375,
"config_test": fal... |
# Hack - expire is added to wms object.
from TileCache.Layer import MetaLayer
import TileCache.Client as WMSClient
class WMS(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
{'name':'url', 'description': 'URL of Remote Layer'},
{'name':'user', 'description': 'U... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layers/WMS.py",
"copies": "1",
"size": "1400",
"license": "mit",
"hash": 8817733148828109000,
"line_mean": 37.8888888889,
"line_max": 120,
"alpha_frac": 0.6121428571,
"autogenerated": false,
"ratio": 3.835616438356164,
"config_test... |
import os, sys
from warnings import warn
from Client import WMS
from Service import TileCacheException
DEBUG = True
class Tile (object):
"""
>>> l = Layer("name", maxresolution=0.019914, size="256,256")
>>> t = Tile(l, 18, 20, 0)
"""
__slots__ = ( "layer", "x", "y", "z", "data" )
def __init__... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layer.py",
"copies": "1",
"size": "17301",
"license": "mit",
"hash": 1776903397782843400,
"line_mean": 35.577167019,
"line_max": 167,
"alpha_frac": 0.5089879198,
"autogenerated": false,
"ratio": 3.5916545567780775,
"config_test": f... |
import struct, time
from sha import sha
from bisect import bisect_left
from Layer import Layer, Tile
from Client import WMS
from Service import Service
class Message (object):
types = ("PING", "PONG", "GET", "PUT", "DELETE")
header = "!20sLHH"
header_len = struct.calcsize(header) ... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Swarm.py",
"copies": "1",
"size": "8068",
"license": "mit",
"hash": -6989246212917296000,
"line_mean": 31.5322580645,
"line_max": 78,
"alpha_frac": 0.5461080813,
"autogenerated": false,
"ratio": 3.7300046232085067,
"config_test": f... |
import sys
from TileCache.Layer import MetaLayer
class Mapnik(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
{'name':'mapfile', 'description': 'Location of Mapnik XML map description.'},
{'name':'projection', 'description': 'Target map projection.'},
... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layers/Mapnik.py",
"copies": "1",
"size": "3283",
"license": "mit",
"hash": -91826291102492420,
"line_mean": 36.3068181818,
"line_max": 131,
"alpha_frac": 0.514468474,
"autogenerated": false,
"ratio": 4.219794344473008,
"config_tes... |
"""
ArcXML support. This layer will make requests to an ArcIMS server.
"""
from TileCache.Layer import MetaLayer
from TileCache.Service import TileCacheException
import urllib
import xml.dom.minidom as m
class ArcXML(MetaLayer):
config_properties = [
{'name':'name', 'description': 'Name of Layer'},
... | {
"repo_name": "pcucurullo/groot",
"path": "public/cgi/TileCache/Layers/ArcXML.py",
"copies": "1",
"size": "4837",
"license": "mit",
"hash": -75256985102220140,
"line_mean": 38.6475409836,
"line_max": 374,
"alpha_frac": 0.5629522431,
"autogenerated": false,
"ratio": 3.54099560761347,
"config_tes... |
"""
Provides a subclass of Disk Cache which saves in a simple z/x/y.extension, with
Y=0 being the top of the map, and heading down. This tile layout makes for
generation of tiles that is friendly to Google/OSM, and the opposite of TMS.
This is useful for pre-generating tiles for Google Maps which are going to be
used ... | {
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"path": "public/cgi/tilecache/TileCache/Caches/GoogleDisk.py",
"copies": "7",
"size": "1540",
"license": "mit",
"hash": 5718205599991471000,
"line_mean": 34.8139534884,
"line_max": 82,
"alpha_frac": 0.6461038961,
"autogenerated": fa... |
import subprocess
from docutils import nodes
from distutils.version import LooseVersion
from sphinx import __version__ as sphinx_version
from sphinx.highlighting import PygmentsBridge
from pygments.formatters.latex import LatexFormatter
project = 'Data Plane Development Kit'
if LooseVersion(sphinx_version) >= LooseV... | {
"repo_name": "marqs85/mtcp",
"path": "dpdk-16.04/doc/guides/conf.py",
"copies": "9",
"size": "6187",
"license": "bsd-3-clause",
"hash": 6804332677797596000,
"line_mean": 38.6602564103,
"line_max": 102,
"alpha_frac": 0.6728624535,
"autogenerated": false,
"ratio": 4.146782841823057,
"config_test... |
from polltask.logger import get_default_logger
from polltask.ssh_pexpect import SSHPexpect
class SSHConnection(object):
"""
Module for create session to host.
Implement send_expect/copy function upper SSHPexpet module.
"""
def __init__(self, host, username, password='', login_expected='# ', log... | {
"repo_name": "xuweiliang/Codelibrary",
"path": "polltask/ssh_connection.py",
"copies": "1",
"size": "4680",
"license": "apache-2.0",
"hash": 2049008063405436700,
"line_mean": 36.44,
"line_max": 115,
"alpha_frac": 0.6508547009,
"autogenerated": false,
"ratio": 3.9965841161400513,
"config_test":... |
# Test functions
import pexpect
# default autotest, used to run most tests
# waits for "Test OK"
def default_autotest(child, test_name):
child.sendline(test_name)
result = child.expect(["Test OK", "Test Failed",
"Command not found", pexpect.TIMEOUT], timeout=900)
if result ==... | {
"repo_name": "ipdcode/containerdns",
"path": "kdns/dpdk-17.02/app/test/autotest_test_funcs.py",
"copies": "4",
"size": "9523",
"license": "mit",
"hash": -4298726631709594600,
"line_mean": 30.5331125828,
"line_max": 78,
"alpha_frac": 0.5159088523,
"autogenerated": false,
"ratio": 3.97122602168473... |
MODULE_AUTHOR = "Kaadmy"
MODULE_VERSION = ["0", "1"]
####################
# VECTOR #
####################
X = R = 0
Y = G = 1
Z = B = 2
W = A = 3
class Vector:
def __init__(self, size = 3, val = 0):
self.axes = [0] * size
if type(val) == list:
for axis in range(len(val)... | {
"repo_name": "kaadmy/armory",
"path": "pybzw/pybzw.py",
"copies": "1",
"size": "4963",
"license": "bsd-2-clause",
"hash": -5301437679399370000,
"line_mean": 28.0233918129,
"line_max": 106,
"alpha_frac": 0.5565182349,
"autogenerated": false,
"ratio": 3.8235747303543914,
"config_test": false,
... |
# BSD license.
import networkx as nx
__all__ = ['cytoscape_data', 'cytoscape_graph']
_attrs = dict(name='name', ident='id')
def cytoscape_data(G, attrs=None):
"""Returns data in Cytoscape JSON format (cyjs).
Parameters
----------
G : NetworkX Graph
Returns
-------
data: dict
... | {
"repo_name": "sserrot/champion_relationships",
"path": "venv/Lib/site-packages/networkx/readwrite/json_graph/cytoscape.py",
"copies": "1",
"size": "3097",
"license": "mit",
"hash": -5538698655504961000,
"line_mean": 26.6517857143,
"line_max": 75,
"alpha_frac": 0.5208266064,
"autogenerated": false,... |
'''BSD model'''
import os
import sys
import time
sys.path.append('../')
import numpy as np
import tensorflow as tf
import harmonic_network_lite as hl
def to_4d(x):
"""Convert tensor to 4d"""
xsh = np.asarray(x.get_shape().as_list())
return tf.reshape(x, [xsh[0], xsh[1], xsh[2], np.prod(xsh[3:])])
def... | {
"repo_name": "deworrall92/groupConvolutions",
"path": "BSD500/BSD_model.py",
"copies": "2",
"size": "9048",
"license": "mit",
"hash": -1676180175613051100,
"line_mean": 37.6666666667,
"line_max": 90,
"alpha_frac": 0.5723916888,
"autogenerated": false,
"ratio": 2.721203007518797,
"config_test":... |
# bseditor.models.py
import logging, os
from django.conf import settings
from django.core.management import call_command
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify
import sass
from awl.absmodels import TimeTrackModel
from wrench.uti... | {
"repo_name": "cltrudeau/django-bootstrap-editor",
"path": "bseditor/models.py",
"copies": "1",
"size": "6410",
"license": "mit",
"hash": -5222338876199206000,
"line_mean": 33.4623655914,
"line_max": 80,
"alpha_frac": 0.6249609984,
"autogenerated": false,
"ratio": 4.108974358974359,
"config_tes... |
def decodeHTML(data):
data = stripTags(data)
data = uHTML(data)
return data.strip()
def gismeteo(mType, source, body):
if body:
ls = body.split()
Numb = ls.pop(0)
if ls and Numb.isdigit():
City = body[(body.find(Numb) + len(Numb) + 1):].strip()
Numb = int(Numb)
else:
Numb, City = (None, body)
... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/gismeteo.py",
"copies": "3",
"size": "2992",
"license": "apache-2.0",
"hash": -1513385809970111000,
"line_mean": 39.7536231884,
"line_max": 425,
"alpha_frac": 0.54037709,
"autogenerated": false,
"ratio": 2.36417157275021,
"config_test... |
#-extmanager-extVer:2.2-#
#-extmanager-conflict:extensions/isgd-shortener.py-#
def url_shortener(mType, source, body):
if body:
protocol, _ = body.split("://")[:2]
raw = _.split("/", 1)
if len(raw) > 1:
domain, page = raw
page = "/" + page
else:
domain, page = raw[0], ""
domain = IDNA(domain)
if... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/uto-shortener.py",
"copies": "1",
"size": "1463",
"license": "apache-2.0",
"hash": -8282698638413001000,
"line_mean": 32.8837209302,
"line_max": 94,
"alpha_frac": 0.6236263736,
"autogenerated": false,
"ratio": 2.711359404096834,
"conf... |
# BS mark.1-55
# /* coding: utf8 */
# BlackSmith Bot Plugin
# © simpleApps Unofficial.
Langs = {'en': u'Английский',
'ja': u'Японский',
'ru': u'Русский',
'auto': u'Авто',
'sq': u'Албанский',
# 'ar': u'Арабский',
'af': u'Африкаанс',
'be': u'Белорусский',
'bg': u'Болгарский',
'cy': u'Валлийский... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/trans.py",
"copies": "3",
"size": "3073",
"license": "apache-2.0",
"hash": -7731593049102133000,
"line_mean": 26.3548387097,
"line_max": 97,
"alpha_frac": 0.5699685535,
"autogenerated": false,
"ratio": 1.7235772357723578,
"config_test": f... |
# BS mark.1-55
# /* coding: utf-8 */
# Code © WitcherGeralt, 2012.
# Originally coded for BlackSmith mark.2
get_disp = lambda disp: "%s@%s" % (disp._owner.User, disp._owner.Server) if isinstance(disp, (xmpp.Client, xmpp.dispatcher.Dispatcher)) else disp
ALIVE_KEEPER = {}
def alive_keeper():
def alive_keeper_answ... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/alive_keeper.py",
"copies": "2",
"size": "2458",
"license": "apache-2.0",
"hash": -3884632499884913700,
"line_mean": 25.4301075269,
"line_max": 145,
"alpha_frac": 0.6446886447,
"autogenerated": false,
"ratio": 2.6648590021691976,
"c... |
# BS mark.1-55
# coding: utf-8
# BlackSmith compatibility with Talisman bot
# __talisman__.py
# © simpleApps, 2012
#-extmanager-extVer:2.4.2-#
#-extmanager-conflict:extensions/talisman-pc.py-#
import traceback
GROUPCHAT_CACHE_FILE = GROUPCHATS_FILE
PLUGIN_DIR = "talisman"
## Config compability.
CONNECT_SERVER = ... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/__talisman__.py",
"copies": "1",
"size": "6252",
"license": "apache-2.0",
"hash": 7038747344949757000,
"line_mean": 25.2595744681,
"line_max": 118,
"alpha_frac": 0.6891410049,
"autogenerated": false,
"ratio": 2.677951388888889,
"confi... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith Extension Manager
# This plugin distributed under Apache 2.0 license.
# (c) simpleApps, 2012 — 2013.
## NOTICE:
## All plugins that depend from another plugins or files (not help files that placed in help dir)
## Must be contain this code: #-extmanager-depends:de... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/extmanager.py",
"copies": "3",
"size": "7858",
"license": "apache-2.0",
"hash": -6103133264051127000,
"line_mean": 30.9118942731,
"line_max": 100,
"alpha_frac": 0.6230843573,
"autogenerated": false,
"ratio": 2.536952714535902,
"conf... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# antiwipe.py
# Copyleft
GoodServers = ["jabber.ru", "xmpp.ru", # add 2ch.so maybe
"jabber.cz", "jabbim.cz",
"gtalk.com", "gmail.com",
"jabbers.ru", "xmpps.ru",
"gajim.org", "jabbim.com",
"jabberon.ru", "jabbrik.ru",
"talkonaut.com"... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/antiwipe.py",
"copies": "3",
"size": "5482",
"license": "apache-2.0",
"hash": 2145807011273769000,
"line_mean": 34.3356164384,
"line_max": 106,
"alpha_frac": 0.6082574142,
"autogenerated": false,
"ratio": 2.416393442622951,
"config_... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# boltun.py
# Copyleft
#-extmanager-extVer:2.2-#
BOLTUN_FILE = 'dynamic/boltun.txt'
FLOOD = {}
FRAZA_BOT = {}
FRAZA_RANDOM = ['WTF?', 'How are you?', 'What the beatiful day!']
FRAZA_USER = {}
FRAZA_ALL = {}
def boltun_check_nick(item, conf):
if conf in... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/boltun.py",
"copies": "1",
"size": "7502",
"license": "apache-2.0",
"hash": -6363302242915468000,
"line_mean": 29.5921052632,
"line_max": 122,
"alpha_frac": 0.6322580645,
"autogenerated": false,
"ratio": 2.2572815533980584,
"config_te... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# bomba.py
# Coded by: 40tman (40tman@qip.ru)
# ReCoded: by WitcherGeralt (WitcherGeralt@jabber.ru)
#-extmanager-extVer:1.3-#
COLOR = [u'красный', u'зеленый', u'синий', u'голубенький', u'белый', u'желтый', u'серый', u'оранжевый', u'фиолетовый', u'серо-буро... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/bomba.py",
"copies": "1",
"size": "2166",
"license": "apache-2.0",
"hash": 2464157955893065000,
"line_mean": 29.0634920635,
"line_max": 195,
"alpha_frac": 0.6541710665,
"autogenerated": false,
"ratio": 2.038751345532831,
"config_test"... |
# BlackSmith mark.1
# commoff_plugin.py
# Initial Copyright © 2007 Als [Als@exploit.in]
# Modifications: WitcherGeralt [WitcherGeralt@rocketmail.com]
NACMD = [u'доступ', u'логин', u'логаут', u'доступ_лок', u'свал', u'команды', u'отключить', u'включить', u'комлист', u'хтобыл', u'хдея', u'хелп', u'комдоступ', u'су... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/commoff.py",
"copies": "3",
"size": "4945",
"license": "apache-2.0",
"hash": -2298693024076365800,
"line_mean": 33.096,
"line_max": 183,
"alpha_frac": 0.6196621305,
"autogenerated": false,
"ratio": 2.066925315227934,
"config_test": false,... |
# BS mark.1-55
# coding: utf-8
# BlackSmith mark.1
# converter.py
# Code © (2012) by WitcherGeralt [alkorgun@gmail.com]
#-extmanager-extVer:0.8-#
CrDesc = {
"time": { # Время
"year": 1.0, # Год !# Base (Базовое Значение)
"month": 12.0, # Месяц
"week": 52.1785714286, # Неделя
"day": 365.25, # День
"hou... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/converter.py",
"copies": "1",
"size": "9768",
"license": "apache-2.0",
"hash": -1514927921864674600,
"line_mean": 37.9909090909,
"line_max": 107,
"alpha_frac": 0.6151783633,
"autogenerated": false,
"ratio": 1.8009657778710897,
"config... |
# BlackSmith mark.1
# delirium_plugin.py
# Author: Als [Als@exploit.in]
# Modifications: WitcherGeralt [WitcherGeralt@rocketmail.com]
def handler_poke(type, source, nick):
if type == 'public':
if nick:
if not nick == handler_botnick(source[1]):
if nick in GROUPCHATS[source[1]]:
pokes = []
pok... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/delirium.py",
"copies": "3",
"size": "2784",
"license": "apache-2.0",
"hash": -2839527076531289600,
"line_mean": 25.198019802,
"line_max": 65,
"alpha_frac": 0.6107331822,
"autogenerated": false,
"ratio": 2.4752104770813843,
"config_te... |
# BlackSmith mark.1
# info_plugin.py
# Author:
# Als [Als@exploru.net]
# Modifications:
# WitcherGeralt [WitcherGeralt@rocketmail.com]
def handler_true_jid(type, source, nick):
if nick:
if source[1] in GROUPCHATS:
if nick in GROUPCHATS[source[1]]:
jid = handler_jid(source[1]+'/'+nick)
if type == 'p... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/info.py",
"copies": "3",
"size": "1450",
"license": "apache-2.0",
"hash": 5759421698311468000,
"line_mean": 28.2666666667,
"line_max": 75,
"alpha_frac": 0.6332574032,
"autogenerated": false,
"ratio": 2.1986644407345577,
"config_test": fal... |
# BlackSmith mark.1
# macro_plugin.py
# Author:
# dimichxp [dimichxp@gmail.com]
# Modifications:
# Als [Als@exploit.in]
# WitcherGeralt [WitcherGeralt@rocketmail.com]
# mrDoctorWho [support@simpleapps.ru]
def handler_local_macro(type, source, Params):
if source[1] in GROUPCHATS:
if Params:
keys = Params.... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/macro.py",
"copies": "2",
"size": "8984",
"license": "apache-2.0",
"hash": 3854881061486317000,
"line_mean": 32.5125,
"line_max": 103,
"alpha_frac": 0.6161879896,
"autogenerated": false,
"ratio": 2.3012875536480686,
"config_test": f... |
# BlackSmith mark.1
# macro_plugin.py
# Author:
# dimichxp [dimichxp@gmail.com]
# Modifications:
# Als [Als@exploit.in]
# WitcherGeralt [WitcherGeralt@rocketmail.com]
# simpleApps [support@simpleapps.ru]
def handler_local_macro(type, source, Params):
if source[1] in GROUPCHATS:
if Params:
keys = Params.s... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/macro.py",
"copies": "1",
"size": "8983",
"license": "apache-2.0",
"hash": -3782774808772667400,
"line_mean": 32.5083333333,
"line_max": 103,
"alpha_frac": 0.6161402636,
"autogenerated": false,
"ratio": 2.3023189235614083,
"config_tes... |
# BlackSmith mark.1
# order_plugin.py
# Initial Copyright © 2007 Als <Als@exploit.in>
# First Version and Idea © 2007 dimichxp <dimichxp@gmail.com>
OBSCENE2 = u'бляд/ блят/ бля / блять / плять /хуй/ ибал/ ебал/ хуи/хуител/хуя/ хую/ хуе/ ахуе/ охуе/хуев/ хер /хер/ пох / нах /писд/пизд/рizd/ пздц / еб/ епана / епа... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/order.py",
"copies": "3",
"size": "19749",
"license": "apache-2.0",
"hash": -8655454508035948000,
"line_mean": 36.0189873418,
"line_max": 563,
"alpha_frac": 0.6125263578,
"autogenerated": false,
"ratio": 2.2273419649657273,
"config_test":... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# pingx.py
# © (2004) Lars Strand
ICMP_DATA_STR = 56
ICMP_TYPE = 8
ICMP_TYPE_IP6 = 128
ICMP_CODE = 0
ICMP_CHECKSUM = 0
ICMP_ID = 0
ICMP_SEQ_NR = 0
def Packet_construct(id, size, ipv6):
if size < int(struct.calcsize("d")):
_error("packetsize to small, mus... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/pingx.py",
"copies": "3",
"size": "7050",
"license": "apache-2.0",
"hash": 874860777489971700,
"line_mean": 31.1062801932,
"line_max": 149,
"alpha_frac": 0.6051760457,
"autogenerated": false,
"ratio": 2.300449982692973,
"config_test... |
# BS mark.1-55
# coding: utf-8
# BlackSmith mark.1
# plugin.py
# Copyleft
OUT_COMMANDS = {}
def handler_out_list(type, source):
if OUT_COMMANDS:
repl = u'Список отключённых команд: '+', '.join(sorted(OUT_COMMANDS.keys()))
else:
repl = u'Оключённых команд нет!'
reply(type, source, repl)
def handler_comman... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/plugin.py",
"copies": "3",
"size": "2725",
"license": "apache-2.0",
"hash": 98197084399162740,
"line_mean": 27.6428571429,
"line_max": 102,
"alpha_frac": 0.6600166251,
"autogenerated": false,
"ratio": 2.1833030852994555,
"config_test"... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# quiz.py
# (c) Gigabyte
# http://jabbrik.ru
#-extmanager-depends:static/questions.txt-#
#-extmanager-extVer:2.0-#
QUIZ_FILE = 'static/questions.txt'
QUIZ_TOTAL_LINES = 10240
QUIZ_TIME_LIMIT = 200
QUIZ_IDLE_LIMIT = 3
QUIZ_RECURSIVE_MAX = 20
QUIZ_CURRENT_A... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/quiz.py",
"copies": "1",
"size": "14564",
"license": "apache-2.0",
"hash": -2566467016549529600,
"line_mean": 31.649382716,
"line_max": 569,
"alpha_frac": 0.639718672,
"autogenerated": false,
"ratio": 2.119070512820513,
"config_test":... |
# BS mark.1-55
# coding: utf-8
# BlackSmith mark.1
# recmd.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
REINIT_FILE = 'dynamic/reinit.txt'
RECMDS = {'list': [], 'name': {}, 'access': {}}
def handler_reinit_command(type, source, body):
if body:
list = body.split()
if ... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/recmd.py",
"copies": "3",
"size": "5709",
"license": "apache-2.0",
"hash": -1536887683090515200,
"line_mean": 34.6510067114,
"line_max": 129,
"alpha_frac": 0.5984563253,
"autogenerated": false,
"ratio": 2.4950681070925316,
"config_test": ... |
# BlackSmith mark.1
# rss.py
# Copyright: Unknown author © ????
# Licensed under GPL v2 (as part of neutron-bot)
#-extmanager-extVer:1.1-#
from xml.sax import make_parser, handler
RSS_CACHE_FILE = 'dynamic/RSS_CACHE.txt'
RSS_INTERVAL = 30
RSS_QUERY_DELAY = 10
RSS_ITEM_DELAY = 120
RSS_CONFS = {}
RSS_CACHE = {}
l... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/rss.py",
"copies": "1",
"size": "7539",
"license": "apache-2.0",
"hash": -1301913744218693000,
"line_mean": 27.9296875,
"line_max": 189,
"alpha_frac": 0.6266540643,
"autogenerated": false,
"ratio": 2.7748220307231173,
"config_test": f... |
# BlackSmith mark.1
# send_plugin.py
# Initial Copyright © 2007 Als <Als@exploit.in>
# Help Copyright © 2007 dimichxp <dimichxp@gmail.com>
SEND_CACHE = {}
def handler_send_save(ltype, source, body):
if source[1] in GROUPCHATS:
args = body.split()
if len(args) >= 2:
date = time.strftime('%Y-%m-%d %H:%M:%... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/send.py",
"copies": "3",
"size": "2331",
"license": "apache-2.0",
"hash": 4782485845308162000,
"line_mean": 32.21875,
"line_max": 87,
"alpha_frac": 0.6349952963,
"autogenerated": false,
"ratio": 2.2689434364994665,
"config_test": false,
... |
# BlackSmith mark.1
# status_plugin.py
# Initial Copyright © 2007 Als <Als@exploit.in>
USER_STATUS = {}
def handler_status(type, source, nick):
if source[1] in GROUPCHATS:
if nick:
if nick in USER_STATUS[source[1]]:
status = USER_STATUS[source[1]][nick]['status']
stmsg = USER_STATUS[source[1]][nick... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/status.py",
"copies": "3",
"size": "1233",
"license": "apache-2.0",
"hash": 377957393963389800,
"line_mean": 23.387755102,
"line_max": 61,
"alpha_frac": 0.6393305439,
"autogenerated": false,
"ratio": 2.5643776824034337,
"config_test":... |
# BlackSmith mark.1
# time_plugin.py
# Initial Copyright © 2007 Als <Als@exploit.in>
# Modifications Copyright © 2007 dimichxp <dimichxp@gmail.com>
def handler_gettime_xep_disco(type, source, body):
if source[1] in GROUPCHATS:
if body:
jid = source[1]+'/'+body
if body in GROUPCHATS[source[1]]:
if GR... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/time.py",
"copies": "3",
"size": "5221",
"license": "apache-2.0",
"hash": -820300478023798900,
"line_mean": 30.4025157233,
"line_max": 131,
"alpha_frac": 0.5854195874,
"autogenerated": false,
"ratio": 2.4583948793697687,
"config_test"... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# © mrDoctorWho & WitcherGeralt, 2011 — 2013.
## server stats.
def command_server_stats(mType, source, server):
if not server:
server = SERVER
INFO["outiq"] += 1
iq = xmpp.Iq("get", to = server)
iq.addChild("query", namespace = xmpp.NS_STATS)
jClient.... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/get_iq.py",
"copies": "2",
"size": "8687",
"license": "apache-2.0",
"hash": -3218045280729738000,
"line_mean": 27.7275862069,
"line_max": 133,
"alpha_frac": 0.6194477791,
"autogenerated": false,
"ratio": 2.5242424242424244,
"config_... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# © simpleApps & WitcherGeralt, 2011 — 2013.
## server stats.
def command_server_stats(mType, source, server):
if not server:
server = SERVER
INFO["outiq"] += 1
iq = xmpp.Iq("get", to = server)
iq.addChild("query", namespace = xmpp.NS_STATS)
jClient.S... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/get_iq.py",
"copies": "1",
"size": "8687",
"license": "apache-2.0",
"hash": -1646486221438982400,
"line_mean": 27.724137931,
"line_max": 133,
"alpha_frac": 0.6193277311,
"autogenerated": false,
"ratio": 2.525007578053956,
"config_test... |
# BlackSmith mark.1
# vote.py
# Author:
# Mike Mintz [mikemintz@gmail.com]
# Modifications:
# Als [Als@exploit.in]
# WitcherGeralt [WitcherGeralt@rocketmail.com]
#-extmanager-extVer:1.4-#
VOTE_FILE = 'dynamic/vote.txt'
POLLINGS = {}
def handler_vote_vote(type, source, Params):
jid = handler_jid(source[0])
i... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/vote.py",
"copies": "1",
"size": "17722",
"license": "apache-2.0",
"hash": 1295279121285764400,
"line_mean": 43.0429799427,
"line_max": 391,
"alpha_frac": 0.6528527747,
"autogenerated": false,
"ratio": 2.164015204843024,
"config_test"... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# xboltun.py
# Copyleft
#-extmanager-depends:static/boltun/ident_base.txt;static/boltun/random_base.txt-#
#-extmanager-extVer:1.5-#
IDENT_BASE = 'static/boltun/ident_base.txt'
RAND_BASE = 'static/boltun/random_base.txt'
BASE_LINES = 0
boltun_base = open(... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/xboltun.py",
"copies": "1",
"size": "2511",
"license": "apache-2.0",
"hash": 7284947533223512000,
"line_mean": 25.5505617978,
"line_max": 81,
"alpha_frac": 0.6449428692,
"autogenerated": false,
"ratio": 2.2919495635305527,
"config_tes... |
# BlackSmith plugin
# access_plugin.py
# Author:
# Mike Mintz [mikemintz@gmail.com]
# Modifications:
# Als [Als@exploit.in]
# WitcherGeralt [WitcherGeralt@rocketmail.com]
ACCESS_LIST = {'-100': u'(полный игнор)', '-5': u'(заблокирован)', '0': u'(никто)','1': '(lol)', '10': u'(юзер)', '11': u'(мембер)', '15': u'... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/access.py",
"copies": "3",
"size": "8204",
"license": "apache-2.0",
"hash": 8547133754492484000,
"line_mean": 36.6612903226,
"line_max": 789,
"alpha_frac": 0.6438258387,
"autogenerated": false,
"ratio": 2.184284377923293,
"config_test": f... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# acclist_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
def global_acclist(type, source, body):
adminslist = u'Список администраторов:'
ignorelist = u'Список игнора:'
acclist = u'Остальные доступы:'
col_1 = ... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/acclist.py",
"copies": "3",
"size": "2753",
"license": "apache-2.0",
"hash": 8473723650838457000,
"line_mean": 26.3,
"line_max": 70,
"alpha_frac": 0.6011396011,
"autogenerated": false,
"ratio": 2.19375,
"config_test": false,
"has_... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# admin_plugin.py
# Coded by WitcherGeralt
def handler_set_prefix(type, source, prefix):
if source[1] in GROUPCHATS:
if prefix:
if prefix.lower() in [u'удалить', 'del', u'дел']:
if source[1] in PREFIX:
del PREFIX[source[1]]
write_file('dy... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/admin.py",
"copies": "3",
"size": "10815",
"license": "apache-2.0",
"hash": 1220669542659238100,
"line_mean": 34.5390334572,
"line_max": 170,
"alpha_frac": 0.6316945607,
"autogenerated": false,
"ratio": 2.17124687712923,
"config_tes... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# afl-list_plugin.py
# Coded by: 40tman (40tman@qip.ru)
# ReCoded: by WitcherGeralt (WitcherGeralt@jabber.ru)
AFLIST_SEARCH = {}
def get_afl_hnd(body):
list = {u'овнер': 'owner', u'админ': 'admin', u'мембер': 'member', u'бан': 'outcast'}
for afl in list.k... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/afl-list.py",
"copies": "3",
"size": "3769",
"license": "apache-2.0",
"hash": -2892161399396301000,
"line_mean": 28.5491803279,
"line_max": 106,
"alpha_frac": 0.5711511789,
"autogenerated": false,
"ratio": 2.5,
"config_test": false,
"ha... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# antibot_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
#-extmanager-extVer:1.4-#
BOTS = 'Jaskier/BlackSmith/ταλιςμαη/talisman/Talisman/Neutron/Юта/fatal/Åmulet/lesman/VIKA/iBot/Storm'.decode('utf-8')
EXCEPT_L... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/antibot.py",
"copies": "1",
"size": "4284",
"license": "apache-2.0",
"hash": -5923756213733306000,
"line_mean": 30.125,
"line_max": 139,
"alpha_frac": 0.655873494,
"autogenerated": false,
"ratio": 2.4087061668681984,
"config_test": fa... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# antispace_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
def handler_antispace(Prs):
chat = Prs.getFrom().getStripped()
if chat in Antispace:
code = Prs.getStatusCode()
if code == '303':
nick = Prs.get... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/antispace.py",
"copies": "3",
"size": "1784",
"license": "apache-2.0",
"hash": 7158068184376260000,
"line_mean": 30.1153846154,
"line_max": 103,
"alpha_frac": 0.6846011132,
"autogenerated": false,
"ratio": 2.3067047075606277,
"confi... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# autoroles_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
AMODER = {}
AKICK = {}
AVSTR = {}
def handler_amoder(type, source, body):
if source[1] in GROUPCHATS:
if body:
args = body.split()
if len(args)... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/autoroles.py",
"copies": "3",
"size": "8306",
"license": "apache-2.0",
"hash": -4221012954213087700,
"line_mean": 33.1291866029,
"line_max": 110,
"alpha_frac": 0.6054955839,
"autogenerated": false,
"ratio": 2.105371900826446,
"config_test... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# botstatus_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
DEF_STATUS = {'message': u'пиши "хелп", чтобы понять как со мной работать', 'status': 'chat'}
STATUS_LIST = {u'ушел': 'away', u'нет': 'xa', u'занят': 'dn... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/botstatus.py",
"copies": "3",
"size": "2888",
"license": "apache-2.0",
"hash": -5495907887401307000,
"line_mean": 35.9726027397,
"line_max": 93,
"alpha_frac": 0.6613560578,
"autogenerated": false,
"ratio": 2.4693504117108875,
"config_... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# bottle_plugin.py
# Idea: 40tman (40tman@qip.ru)
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
#-extmanager-depends:static/bottle.txt-#
#-extmanager-extVer:1.1-#
def handler_bottle(type, source, player):
if type == 'pu... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/bottle.py",
"copies": "1",
"size": "3808",
"license": "apache-2.0",
"hash": 6859849777017273000,
"line_mean": 30.0267857143,
"line_max": 108,
"alpha_frac": 0.5988489209,
"autogenerated": false,
"ratio": 2.299801455989411,
"config_test... |
# BlackSmith plugin
# cipher_plugin.py
# Author: ferym (ferym@jabbim.org.ru)
# http://jabbrik.ru
strip_tags = re.compile(r'<[^<>]+>')
def handler_msk_time(type, source, body):
try:
body = re_search(read_url('http://www.zln.ru/time/', 'Mozilla/5.0'), '<div id="servertime" style="margin-top:40px; margin-bottom:3... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/networktime.py",
"copies": "3",
"size": "1686",
"license": "apache-2.0",
"hash": 8972820835478182000,
"line_mean": 38.7435897436,
"line_max": 250,
"alpha_frac": 0.5935483871,
"autogenerated": false,
"ratio": 2.1349862258953167,
"confi... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# commands_plugin.py
# Idea: 40tman (40tman@qip.ru)
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
def handler_commands(type, source, body):
if body:
if body.count('/'):
if body.count('/') <= 3:
list = body.split... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/commands.py",
"copies": "3",
"size": "1156",
"license": "apache-2.0",
"hash": 4280924088273801000,
"line_mean": 26,
"line_max": 73,
"alpha_frac": 0.5922150139,
"autogenerated": false,
"ratio": 2.5813397129186604,
"config_test": false,
"... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# cron_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
CRCMDS = [u'пинг', u'тест', u'сказать', u'чисть', u'анекдот', u'ботап', u'фоменко', u'рейтинг', 'днс', 'порт']
CRON = {'col': 0, 'tmrs': {}}
def len_cron():... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/cron.py",
"copies": "3",
"size": "5002",
"license": "apache-2.0",
"hash": 7279793380632452000,
"line_mean": 30.7028985507,
"line_max": 136,
"alpha_frac": 0.5915428571,
"autogenerated": false,
"ratio": 2.2621509824198553,
"config_tes... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# download_plugin.py
# Coded by: WitcherGeralt [WitcherGeralt@rocketmail.com]
# http://witcher-team.ucoz.ru/
def build_filename(DIR, name):
name_ = '%s/%s' % (DIR, name)
if not os.path.exists(name_):
return name_
name = 'copy_%s' % (name)
return build_... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/download.py",
"copies": "3",
"size": "1660",
"license": "apache-2.0",
"hash": 2941260120394700000,
"line_mean": 26.0701754386,
"line_max": 99,
"alpha_frac": 0.6305897602,
"autogenerated": false,
"ratio": 2.3308157099697886,
"config_... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# everywhere_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
def handler_everywhere(type, source, body):
if body:
args = body.split()
if len(args) >= 2:
mtype = args[0].strip().lower()
if mtype == u'чат... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/everywhere.py",
"copies": "3",
"size": "1268",
"license": "apache-2.0",
"hash": 8017969198993450000,
"line_mean": 26.8333333333,
"line_max": 97,
"alpha_frac": 0.6313088109,
"autogenerated": false,
"ratio": 2.4662447257383966,
"config_test... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# greetex_plugin.py
# Idea: Gigabyte [gigabyte@ngs.ru]
# Coded by: WitcherGeralt [WitcherGeralt@rocketmail.com]
greet_afls = {u'никто': 'none', u'мембер': 'member', u'админ': 'admin', u'овнер': 'owner'}
GRTX = {}
def handler_greetex(type, source, body):
i... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/greetex.py",
"copies": "3",
"size": "2889",
"license": "apache-2.0",
"hash": -2011619469247466500,
"line_mean": 33.3066666667,
"line_max": 90,
"alpha_frac": 0.6300038865,
"autogenerated": false,
"ratio": 2.18606627017842,
"config_test": f... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# greetz_plugin.py
# Idea: Als [Als@exploit.in]
# Coded by: WitcherGeralt [WitcherGeralt@rocketmail.com]
GREETZ = {}
def handler_greet(type, source, body):
if source[1] in GROUPCHATS:
if body:
args = body.split('=', 1)
if len(args) == 2:
item... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/greetz.py",
"copies": "3",
"size": "2149",
"license": "apache-2.0",
"hash": -8374030866200766000,
"line_mean": 28.8208955224,
"line_max": 73,
"alpha_frac": 0.6121121121,
"autogenerated": false,
"ratio": 2.3178654292343386,
"config_t... |
# BS mark.1-55
# coding: utf-8
# BlackSmith plugin
# help.py
# © mrDoctorWho & WitcherGeralt, 2011 — 2013.
def command_comaccess(type, source, body):
if body:
command = body.lower()
if command in COMMANDS:
access = COMMANDS[command]['access']
reply(type, source, u"Доступ к команде «%s» — %s." % (comman... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/help.py",
"copies": "2",
"size": "3450",
"license": "apache-2.0",
"hash": -6023756779809733000,
"line_mean": 33.1046511628,
"line_max": 119,
"alpha_frac": 0.6443914081,
"autogenerated": false,
"ratio": 2.169378698224852,
"config_test": fa... |
# BS mark.1-55
# coding: utf-8
# BlackSmith plugin
# help.py
# © simpleApps & WitcherGeralt, 2011 — 2013.
def command_comaccess(type, source, body):
if body:
command = body.lower()
if command in COMMANDS:
access = COMMANDS[command]['access']
reply(type, source, u"Доступ к команде «%s» — %s." % (command... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/help.py",
"copies": "1",
"size": "3449",
"license": "apache-2.0",
"hash": -782793084027301100,
"line_mean": 33.0930232558,
"line_max": 119,
"alpha_frac": 0.6442701228,
"autogenerated": false,
"ratio": 2.171851851851852,
"config_test":... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# holidays_plugin.py
# Coded by: 40tman (40tman@qip.ru)
def handler_holidays(type, source, body):
try:
data = read_url('http://wap.n-urengoy.ru/cgi-bin/wappr.pl', 'Mozilla/5.0')
data = re_search(data, '<div class="title">', 'назад')
list = {'<': '', '... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/holydays.py",
"copies": "3",
"size": "1162",
"license": "apache-2.0",
"hash": -5242580333376441000,
"line_mean": 58.3157894737,
"line_max": 606,
"alpha_frac": 0.3593611358,
"autogenerated": false,
"ratio": 2.286004056795132,
"config... |
# BlackSmith plugin
# Interpreter Plugin
# Idea (c) Unknown Author
# Code (c) simpleApps, 2011
def pyEval(mType, source, code):
try: result = unicode(eval(code))
except Exception: result = returnExc()
if not result:
result = `result`
reply(mType, source, result)
def pyExec(mType, source, code):
result = u... | {
"repo_name": "cobrab11/black1-bot",
"path": "extensions/interpreter.py",
"copies": "3",
"size": "1472",
"license": "apache-2.0",
"hash": -3041972172439828000,
"line_mean": 26.5849056604,
"line_max": 71,
"alpha_frac": 0.6605065024,
"autogenerated": false,
"ratio": 2.853515625,
"config_test": fa... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# invite.py
# © simpleApps, 2013.
inviteChatrooms = []
def command_sendInvite(mType, source, nick):
chat = source[1]
if chat in GROUPCHATS:
if chat not in inviteChatrooms:
if nick:
jid = None
if "@" in nick or "." in nick:
jid = nick
... | {
"repo_name": "vlasov7777/blacksmith-bot",
"path": "extensions/invite.py",
"copies": "3",
"size": "1363",
"license": "apache-2.0",
"hash": -1554181753686516700,
"line_mean": 28.6341463415,
"line_max": 108,
"alpha_frac": 0.6449752883,
"autogenerated": false,
"ratio": 2.3036053130929792,
"config_... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# macrokill_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
def handler_set_botnick(type, source, body):
if source[1] in GROUPCHATS:
if body:
nick = replace_all(body, {' ': '_', '"': '', "'": ''})
if len(... | {
"repo_name": "Manazius/blacksmith-bot",
"path": "extensions/macrokill.py",
"copies": "3",
"size": "5420",
"license": "apache-2.0",
"hash": 3322039735439657000,
"line_mean": 32.8041958042,
"line_max": 129,
"alpha_frac": 0.6189491105,
"autogenerated": false,
"ratio": 2.1735611510791366,
"config_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.