code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#! /opt/local/bin/python2.6
import numpy as np
import time
import sys
from rwEXR import *
# 3744 23.9
# 5616 35.8
# distortion correction parameters in rad
# 0.207029529537 0.0422547753997
entrancePixel = (2323,5615-2427) #5
entrancePixel = (2622,5615-1935) #6
entrancePixel = (3123,5615-1859) #7
entrancePixel = (... | Python |
#! /opt/local/bin/python2.6
import numpy as np
import time
import sys
from rwEXR import *
# 3744 23.9
# 5616 35.8
# distortion correction parameters in rad
# 0.207029529537 0.0422547753997
entrancePixel = (3473,5615-3043)
#entrancePixel = (1848,5615-2341)
#center = (1867.5,5616-2979.5)
#center = (1884.18,2834.89... | Python |
#! /opt/local/bin/python2.6
import numpy as np
import time
import sys
from rwEXR import *
# 3744 23.9
# 5616 35.8
# distortion correction parameters in rad
# 0.207029529537 0.0422547753997
entrancePixel = (3479,5615-2224) #1
entrancePixel = (3341,5615-2345) #2
#entrancePixel = (3127,5615-2538) #3
physicCenter = (... | Python |
#! /opt/local/bin/python2.6
import numpy as np
import time
import sys
from rwEXR import *
# 3744 23.9
# 5616 35.8
# distortion correction parameters in rad
# 0.207029529537 0.0422547753997
entrancePixel = (3341,5615-2345)
#entrancePixel = (1867.5 + 300,2979.5)
center = (1867.5,2979,5)
f = 8
d = 89+79
T1 = np.... | Python |
#! /opt/local/bin/python2.6
import numpy as np
import time
import sys
from rwEXR import *
# 3744 23.9
# 5616 35.8
# distortion correction parameters in rad
# 0.207029529537 0.0422547753997
entrancePixel = (2323,5615-2427) #5
entrancePixel = (2622,5615-1935) #6
entrancePixel = (3123,5615-1859) #7
entrancePixel = (... | Python |
#! /opt/local/bin/python2.6
import numpy as np
import time
import sys
from rwEXR import *
# 3744 23.9
# 5616 35.8
# distortion correction parameters in rad
# 0.207029529537 0.0422547753997
entrancePixel = (3341,5615-2345)
#entrancePixel = (1848,5615-2341)
physicCenter = (1867.5,5615-2979.5)
#center = (1884.18,28... | Python |
import OpenEXR
import Imath
import math
import numpy as np
def readExr(exrfile):
exrfile = str(exrfile)
file = OpenEXR.InputFile(exrfile)
pt = Imath.PixelType(Imath.PixelType.FLOAT)
dw = file.header()['dataWindow']
size = (dw.max.x - dw.min.x + 1, dw.max.y - dw.... | Python |
import OpenEXR
import Imath
import math
import time
import numpy as np
def writeEXR(fileName,outputR,outputG,outputB, sz):
print "Writing "+fileName
(strR, strG, strB) = [Channel.tostring() for Channel in (outputR, outputG, outputB)]
patchOut = OpenEXR.OutputFile(fileName, OpenEXR.Header(sz[... | Python |
import os, sys
import OpenEXR
import Imath
import math
import time
import numpy
from numpy import array
np = numpy
import myextension
def readExr(exrfile):
exrfile = str(exrfile)
file = OpenEXR.InputFile(exrfile)
pt = Imath.PixelType(Imath.PixelType.FLOAT)
dw = file.header()['dataWindo... | Python |
import numpy as N
import ctypes as C
ctypesDict = {'d' : C.c_double,
'b' : C.c_char,
'h' : C.c_short,
'i' : C.c_int,
'l' : C.c_long,
'q' : C.c_longlong,
'B' : C.c_ubyte,
'H' : C.c_ushort,
'I' : C.c_uint,
... | Python |
env = Environment()
DEBUG = ARGUMENTS.get('DEBUG','0')
#env.Replace(CFLAGS=['-O2','-Wall','-ansi','-pedantic'])
#env.Replace(CFLAGS=['-O2','-Wall','-ansi','-pedantic'])
env.Replace(CPPPATH=['/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include','/opt/local/include'])
if DEBUG=='1':
print "DEBUG"
... | Python |
"""
Basic functions and utilities
"""
class RepoConfig(object):
def __init__(self):
self.repos = {}
self.defaults = {}
self.autoUpdatePath = True
def get3(self, opt, repo, path):
if not (repo, opt) in self.repos:
return self.defaults.get(opt)
keys, map = self.repos[repo, opt]
for k... | Python |
import os, sys, unittest
import pysvn
from mock import Mock
from svncommitchecker import CommitContext
from svncommitchecker import CommitChecker
from scmtools import RepoConfig
class DummyClass(object): pass
class CommitContextTests(unittest.TestCase):
def testBase0(self):
ctx = CommitContext()
ctx.d('deb... | Python |
import os, sys, unittest, inspect
from scmtools import RepoConfig, LoadRepoConfig
from scmtools import VersionString, FileExtMatch
from scmtools import FileExt
class SCMToolsTests(unittest.TestCase):
def testFileExtMatch(self):
assert FileExtMatch(None, 'java')
assert FileExtMatch('', 'java')
assert File... | Python |
# -*- coding: utf8 -*-
#
# -- Subversion Pre Commit Hook --
#
__VERSION__ = '0.0.1.1'
__PROGNAME__ = 'IS Subversion Precommit Checker'
import sys, os
import pysvn
from scmtools import RepoConfig, LoadRepoConfig, FileExtMatch, VersionString, FileExt
class CommitContext(object):
def __init__(self):
self.debugs ... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Space - Simple file storage service
#
from __future__ import with_statement
SPACE_VERSION = '0.0.3.6'
import time, os, threading
import zlib
from struct import pack as ipack, unpack as iunpack
import constants as CC
from service import ServiceBase
from pro... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Utility
#
import os, time, sys
import socket
from cStringIO import StringIO
from traceback import print_tb, print_stack
def mkdir_p(dir):
if os.path.isdir(dir):
pass
elif os.path.isfile(dir):
raise OSError("a file with same name as the desired " \
... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Debug info
#
__all__ = (
'errorInfo', 'svcInfo', 'returnInfo',)
import constants as CC
errorInfo = {}
svcInfo = {}
returnInfo = {}
def I(d, id):
d[getattr(CC, id)] = id
def EI(id):
I(errorInfo, id)
def SI(id):
I(svcInfo, id)
def RI(id):
I(returnInf... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# WorkSpace
#
WORKSPACE_VERSION = '0.0.2.9'
# -----
import threading
import os, sys
from cStringIO import StringIO
from traceback import print_tb, print_stack
from service import ServiceBase
from protocol import CreateMessage, CreateMessage0, \
GetMessageFro... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Protocol
#
#from cPickle import loads, dumps, HIGHEST_PROTOCOL
from fastmap import _loads as loads, _dumps as dumps
from struct import pack, unpack
from zlib import compress as _compress, decompress as _dcompress
import socket
from o3grid import constants a... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Mission and Job
#
import threading, time
import constants as CC
class MissionBase(object): pass
class SJobBase(object): pass
# ------
# mid - Mission id
# jid - Job ID
# jobid - Full job ID
# mname - Mission name
# jname - Job name
# ------
class Mission(M... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# HUB Service
#
import os
import sys
import constants as CC
from service import ServiceBase
from protocol import O3Channel, O3Call
from utility import D as _D
class HubService(ServiceBase):
SVCID = CC.SVC_HUB
svcDescription = "HUB Service"
svcName = 'HUB'
... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Base service module
#
import threading
import socket
import cPickle as pickle
import struct
import os
import constants as CC
from protocol import CreateMessage0, GetMessageFromSocket, CreateMessage
class ServiceException(Exception):
def __init__(self, *pa... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Base server module
#
BASESERVER_VERSION = '0.0.2.2'
import threading
import socket, struct, time
import cPickle as pickle
import sys, os
import Queue
import constants as CC
import fastmap
from service import BaseService
from protocol import CreateMessage... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Auto Configure Policy
#
import socket
import constants as CC
class AutoConfigPolicy(object):
def __init__(self, service):
self.service = service
self.storageGroup = ['z01', 'z03', 'z15', 'z26']
def autoConfig0(self, channel, group, hostid):
#if not ... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Autoconfig server in O3 grids
#
import threading
import sys
from service import ServiceBase
import constants as CC
class AutoConfigService(ServiceBase):
SVCID = CC.SVC_AUTOCONFIG
svcDescription = "Auto config service"
svcName = 'AUTOCONFIG'
svcVersion =... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# First class schedule
#
from __future__ import with_statement
SCHEDULE0_VERSION = '0.0.1.8'
import sys, time
import operator, random
import threading
import Queue
from service import ServiceBase
from protocol import O3Channel
import constants as CC
from uti... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Name server in O3 grids
#
import threading
from service import ServiceBase
import constants as CC
class NameService(ServiceBase):
SVCID = CC.SVC_NAMES
svcDescription = "Name service"
svcName = 'NAMES'
svcVersion = '0.0.1.0'
def __init__(self, server):... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Warehouse server in O3 grids
#
from __future__ import with_statement
WAREHOUSE_VERSION = '0.0.0.28'
import sys, os, time
import threading
from random import choice, random
import constants as CC
from service import ServiceBase
from protocol import O3Channe... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Constants
#
DEFAULT_PORT = 50333
DEFAULT_LOG_PORT = 50332
DEFAULT_WAREHOUSE_PORT = 50333
DEFAULT_BASE = '/is/app/o3'
# ====
SVC_SYSTEM = 1
SVC_BASE = 2
SVC_SCHEDULE = 1003
SVC_SCHE = SVC_SCHEDULE
SVC_WORKSPACE = 1004
SVC_WS = SVC_WORKSPACE
SVC_FILESYSTEM =... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# DB Layer for Warehouse
#
__all__ = [
'WarehouseDB',
'Entity',
'Room',
]
from sqlalchemy import *
import time
import constants as CC
from utility import appendinmap, removeinmap
from utility import sizeK
class Room(object): pass
class Entity(object): pa... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Config
#
import os
def GetConfigCode(name):
paths = [
'%s/%s' % ('/is/app/o3/etc', name),
name ]
for fn in paths:
if os.path.isfile(fn):
break
fin = file(fn, 'r')
configcode = fin.read()
fin.close()
return configcode
def Load(name):
confi... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# SNIP
#
# ==Description
# Simple space stroage client
#
import socket
import constants as CC
import cStringIO as StringIO
from protocol import CreateMessage, GetMessageFromSocket, O3Space, O3Call
class RemoteSnipClient(object):
def __init__(self, space):
... | Python |
#!/usr/bin/python
from o3grid import constants as CC
BASE = '/is/app/o3'
def B(p, b = BASE):
return '%s/%s' % (b, p)
common = {
'name': 'z00',
'id': 'z00',
'zone': 'o3dev',
'entry': ('10.6.32.197', CC.DEFAULT_PORT),
'base': BASE,
'names': {
'HUB': ('10.6.32.197', CC.DEFAULT_PORT),
'NAMES': ('10.6.32.197',... | Python |
#!python2.5
import os
from o3grid.service import BaseService, EchoService
from o3grid.hub import HubService
from o3grid.baseserver import ServerBase
from o3grid import config
from o3grid.utility import D
from o3grid.protocol import O3Channel
from o3grid import constants as CC
def readfile(fn):
fin = file(fn, 'r')
... | Python |
import socket
import time
fout = file('/is/app/o3/log/o3.log', 'a')
sin = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
sin.bind(('0.0.0.0', 50332))
while True:
try:
buf = sin.recv(300)
log = '%s %s' % (time.strftime('%m%d %H:%M:%S'), buf)
fout.write(log)
fout.write('\n')
fout.flush()
print log... | Python |
#!/usr/bin/python
import pprint
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import time
res = O3Call(('p-dx44-in', CC.DEFAULT_PORT), CC.SVC_WAREHOUSE, 'FLUSHDB')
pprint.pprint(res)
| Python |
from o3lib import fs
import Queue
queue = Queue.Queue()
fs.O3EntityReader(queue,
label = '0',
node = 'p-dx69',
name = 'test/TEST.iz0',
addr = '10.6.39.218',
entityid = 4498)
fout = file('/tmp/TEST_ER01', 'wb')
while True:
c = queue.get()
if not c:
break
print len(c)
fout.write(c)
fout.close()
| Python |
#!/usr/bin/python
import pprint,sys
from o3grid import constants as CC
from o3grid.protocol import O3Call
res = O3Call(('127.0.0.1', CC.DEFAULT_PORT),
CC.SVC_HUB, 'UNLOADO3LIB')
| Python |
#!/usr/bin/python
import pprint,sys
import time
from o3grid import constants as CC
from o3grid.protocol import O3Call
import o3testmisc
#S = O3Channel()
#S.connect(('127.0.0.1', CC.DEFAULT_PORT))
#res = S(CC.SVC_SCHEDULE, 'SUBMITMISSION',
# 'ls01', {
# 'module': 'logsplit01.logsplit01',
# 'missionclass': 'O3Missio... | Python |
#!/usr/bin/python
import pprint
import sys
from o3grid import constants as CC
from o3grid.protocol import O3Channel
import time
entitys = ['1']
if len(sys.argv) > 1:
entitys = []
for x in sys.argv[1:]:
try:
entitys.append(int(x))
except ValueError:
entitys.append(x)
S = O3Channel().connect(('localhost'... | Python |
#!/usr/bin/python
import pprint,sys
import time
from o3grid import constants as CC
from o3grid.protocol import O3Call
import o3testmisc
if len(sys.argv) >= 2:
prefix = sys.argv[1]
else:
prefix = 'uume/2007/01/18'
logname, sep, datename = prefix.partition('/')
mid = 'ODT1-%s-%s' % (logname, datename.replace('/', ... | Python |
#!/usr/bin/python
import pprint
import socket
from o3grid import constants as CC
from o3grid.protocol import O3Channel, O3Call, GetMessageFromSocket
import time
#res = O3Call(('p-dx59-in', CC.DEFAULT_PORT),
# CC.SVC_SPACE, 'ROOMENTITYSPLIT0', '0', 'plog/uume/2006/12/26/2100', 1024 * 1024 * 256)
#pprint.pprint(res)
S ... | Python |
#!/usr/bin/python
import pprint
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import time
res = O3Call(('p-dx44-in', CC.DEFAULT_PORT), CC.SVC_WAREHOUSE, 'FLUSHDB')
pprint.pprint(res)
| Python |
#!/usr/bin/python
import pprint,sys
import time
from o3grid import constants as CC
from o3grid.protocol import O3Call
import o3testmisc
#S = O3Channel()
#S.connect(('127.0.0.1', CC.DEFAULT_PORT))
#res = S(CC.SVC_SCHEDULE, 'SUBMITMISSION',
# 'ls01', {
# 'module': 'logsplit01.logsplit01',
# 'missionclass': 'O3Missio... | Python |
#!/usr/bin/python
import pprint,sys
import time
from o3grid import constants as CC
from o3grid.protocol import O3Call
import o3testmisc
if len(sys.argv) >= 2:
prefix = sys.argv[1]
else:
prefix = 'uume/2007/01/18'
logname, sep, datename = prefix.partition('/')
mid = 'ODT1-%s-%s' % (logname, datename.replace('/', ... | Python |
#!/usr/bin/python
import pprint,sys
from o3grid import constants as CC
from o3grid.protocol import O3Call
res = O3Call(('127.0.0.1', CC.DEFAULT_PORT),
CC.SVC_SCHEDULE, 'CLEANMISSION', 'uume02')
| Python |
#!/usr/bin/python
import pprint
import sys
from o3grid import constants as CC
from o3grid.protocol import O3Channel
import time
entitys = ['1']
if len(sys.argv) > 1:
entitys = []
for x in sys.argv[1:]:
try:
entitys.append(int(x))
except ValueError:
entitys.append(x)
S = O3Channel().connect(('localhost'... | Python |
#!/usr/bin/python
import pprint
import sys, os
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import time
if len(sys.argv) >= 2:
name = sys.argv[1]
else:
name = 'plog/uume/2006/12/31/'
res = O3Call(('p-dx44-in', CC.DEFAULT_PORT), CC.SVC_WAREHOUSE, 'LISTENTITY0', name)
pprint.ppri... | Python |
#!/usr/bin/python
import pprint, sys, time
from o3grid import constants as CC
from o3grid.protocol import O3Call
#S = O3Channel()
#S.connect(('127.0.0.1', CC.DEFAULT_PORT))
#res = S(CC.SVC_SCHEDULE, 'SUBMITMISSION',
# 'ls01', {
# 'module': 'logsplit01.logsplit01',
# 'missionclass': 'O3Mission',
# })
if len(sys.ar... | Python |
#!/usr/bin/python
import pprint
import sys, os
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import time
if len(sys.argv) >= 2:
name = sys.argv[1]
else:
name = 'plog/uume/2006/12/31/'
res = O3Call(('p-dx44-in', CC.DEFAULT_PORT), CC.SVC_WAREHOUSE, 'LISTENTITY0', name)
pprint.pprin... | Python |
#!/usr/bin/python
import pprint
from o3grid import constants as CC
from o3grid.protocol import O3Channel
import time
S = O3Channel().connect(('localhost', CC.DEFAULT_PORT))
res = S(CC.SVC_WAREHOUSE, 'LISTROOM')
pprint.pprint(res[2])
for r in res[2]:
res = S(CC.SVC_WAREHOUSE, 'CLEANROOM', r[0])
pprint.pprint(res)
#... | Python |
#!/usr/bin/python
import pprint,sys
from o3grid import constants as CC
from o3grid.protocol import O3Call
res = O3Call(('127.0.0.1', CC.DEFAULT_PORT),
CC.SVC_HUB, 'UNLOADO3LIB')
| Python |
import os
HOME = os.environ.get('HOME', '/root')
O3PROFILEDIR = HOME + '/.o3'
def IsDebugMission(missionname):
m1 = O3PROFILEDIR + '/_debug/all'
m2 = O3PROFILEDIR + '/_debug/' + missionname
if os.path.exists(m1):
return True
if os.path.exists(m2):
return True
return False
| Python |
#!/usr/bin/python
import pprint, sys, time
from o3grid import constants as CC
from o3grid.protocol import O3Call
#S = O3Channel()
#S.connect(('127.0.0.1', CC.DEFAULT_PORT))
#res = S(CC.SVC_SCHEDULE, 'SUBMITMISSION',
# 'ls01', {
# 'module': 'logsplit01.logsplit01',
# 'missionclass': 'O3Mission',
# })
if len(sys.ar... | Python |
#!/usr/bin/python
import pprint
import sys, os
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import time
if len(sys.argv) >= 2:
name = sys.argv[1]
else:
name = 'plog/uume/2006/12/31/'
res = O3Call(('p-dx44-in', CC.DEFAULT_PORT), CC.SVC_WAREHOUSE, 'LISTENTITY0', name)
pprint.pprin... | Python |
#!/usr/bin/python
import pprint,sys
from o3grid import constants as CC
from o3grid.protocol import O3Call
res = O3Call(('127.0.0.1', CC.DEFAULT_PORT),
CC.SVC_SCHEDULE, 'CLEANMISSION', 'uume02')
| Python |
#!/usr/bin/python
import pprint
from o3grid import constants as CC
from o3grid.protocol import O3Channel
import time
S = O3Channel().connect(('localhost', CC.DEFAULT_PORT))
res = S(CC.SVC_WAREHOUSE, 'LISTROOM')
pprint.pprint(res[2])
for r in res[2]:
res = S(CC.SVC_WAREHOUSE, 'CLEANROOM', r[0])
pprint.pprint(res)
#... | Python |
#!/usr/bin/python
import pprint
import socket
from o3grid import constants as CC
from o3grid.protocol import O3Channel, O3Call, GetMessageFromSocket
import time
#res = O3Call(('p-dx59-in', CC.DEFAULT_PORT),
# CC.SVC_SPACE, 'ROOMENTITYSPLIT0', '0', 'plog/uume/2006/12/26/2100', 1024 * 1024 * 256)
#pprint.pprint(res)
S ... | Python |
#!/usr/bin/python
import pprint
import sys, os
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import time
if len(sys.argv) >= 2:
name = sys.argv[1]
else:
name = 'plog/uume/2006/12/31/'
res = O3Call(('p-dx44-in', CC.DEFAULT_PORT), CC.SVC_WAREHOUSE, 'LISTENTITY0', name)
pprint.ppri... | Python |
#
# O3 base library entry
#
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
__VERSION__ = '0.0.0.2'
class O3(object):
def __init__(self, workspace):
self.ws = workspace
self.localnames = {}
def saveResult(self, name, value, resnodename = 'RESULT'):
respoint = self.localna... | Python |
from struct import pack as ipack, unpack as iunpack
from zlib import decompress as _decompress, MAX_WBITS
from o3grid import constants as CC
from o3grid.protocol import O3Call, O3Channel
import threading
import Queue
# ------
# File services ...
# ------
def O3EntityReader0(queue, **P):
try:
node = P['node']
ad... | Python |
#
# Special compress file format for O3 warehouse
#
# File Structure
# Offset Length
# 0 4B "ISZ0" (4char)
# 4B FLAGS (dowrd)
# 4B VERSION (dword)
# 4B NOUSED, 0
# 16 4B "HD01" (4char)
# 4B NOUSED, 0
# 4B FILE BLOCKS
# ... | Python |
O3LIB_VERSION = '0.0.0.1'
| Python |
#!python2.5
import os
from o3grid.service import BaseService, EchoService
from o3grid.hub import HubService
from o3grid.baseserver import ServerBase
from o3grid import config
from o3grid.utility import D
CONFIG = 'config.o3'
def main():
global CONFIG
if os.environ.has_key('O3_CONFIG'):
CONFIG = os.environ['O3_C... | Python |
#!python2.5
import os
from o3grid.service import BaseService, EchoService
from o3grid.hub import HubService
from o3grid.baseserver import ServerBase
from o3grid import config
from o3grid.utility import D
from o3grid.protocol import O3Channel
from o3grid import constants as CC
def readfile(fn):
fin = file(fn, 'r')
... | Python |
#!/usr/bin/python
from o3grid import constants as CC
BASE = '/is/app/o3'
def B(p, b = BASE):
return '%s/%s' % (b, p)
common = {
'name': 'z00',
'id': 'z00',
'zone': 'o3dev',
'entry': ('10.6.32.197', CC.DEFAULT_PORT),
'base': BASE,
'names': {
'HUB': ('10.6.32.197', CC.DEFAULT_PORT),
'NAMES': ('10.6.32.197',... | Python |
#!python2.5
import os
from o3grid.service import BaseService, EchoService
from o3grid.hub import HubService
from o3grid.baseserver import ServerBase
from o3grid import config
from o3grid.utility import D
CONFIG = 'config.o3'
def main():
global CONFIG
if os.environ.has_key('O3_CONFIG'):
CONFIG = os.environ['O3_C... | Python |
#!/usr/bin/python
import os
SOURCE='/is/app/o3/base'
TARGET='/is/app/o3/o3svn'
def GetINodeNumber(path1):
try:
return os.stat(path1)[1]
except:
return -1
def IsSameFile(path1, path2):
return GetINodeNumber(path1) == GetINodeNumber(path2)
def L(str, chr = '|'):
print '%s %s' % (chr, str)
# ===
def ScanDir... | Python |
#
# ==AUTHOR
# Sin Yu <scaner@gmail.com>
#
# ==MODULE
# Create WareHouse Index DB
#
DBURL = 'mysql://o3:o3indexdb@p-dx44-in/o3'
import sys
sys.path.append('/is/app/o3/lib/o3')
from sqlalchemy import *
def CreateO3WarehouseDatabase(url):
engine = create_engine(url)
metadata = BoundMetaData(engine)
engine.ech... | Python |
#!/usr/bin/python
import os
SOURCE='/is/app/o3/base'
TARGET='/is/app/o3/o3svn'
def GetINodeNumber(path1):
try:
return os.stat(path1)[1]
except:
return -1
def IsSameFile(path1, path2):
return GetINodeNumber(path1) == GetINodeNumber(path2)
def L(str, chr = '|'):
print '%s %s' % (chr, str)
# ===
def ScanDir... | Python |
import os, sys, time
import socket
import random
O3_BASE_PATH = '/is/app/o3'
O3_LIB_PATH = ['base', 'lib/o3']
sys.path.extend([ '%s/%s' % (O3_BASE_PATH, lib) for lib in O3_LIB_PATH])
from o3grid import constants as CC
from o3grid.protocol import O3Channel, O3Call
# -----
def ReadConfigStrFromFile(fn):
fin = file(f... | Python |
import threading, Queue
import os, random, time
import struct, zlib
import cPickle as pickle, cStringIO as StringIO
import operator
from o3grid import constants as CC
from o3grid.utility import cout, D as _D, D2 as _D2, DE as _E
from o3grid.protocol import O3Call, O3Channel, O3Space
from o3grid import job
import o3li... | Python |
#!/usr/bin/python
codebase = {
'name': 'isgrid0',
'version': '0.0.0.1',
'files': [
'isgrid0/__init__.py',
'isgrid0/isgrid0.py',
],
'modules': [
'isgrid0.isgrid0',
'isgrid0',
],
}
| Python |
import threading, Queue
import os, random, time
import struct, zlib
import cPickle as pickle, cStringIO as StringIO
import operator
from o3grid import constants as CC
from o3grid.utility import cout, D as _D, D2 as _D2, DE as _E
from o3grid.protocol import O3Call, O3Channel, O3Space
from o3grid import job
import o3li... | Python |
#!/usr/bin/python
codebase = {
'name': 'oneday01',
'version': '0.0.0.1',
'files': [
'oneday01/__init__.py',
'oneday01/oneday01.py',
],
'modules': [
'oneday01.oneday01',
'oneday01',
],
}
| Python |
#!/usr/bin/python
codebase = {
'name': 'oneday02',
'version': '0.0.0.1',
'files': [
'oneday02/__init__.py',
'oneday02/oneday02.py',
],
'modules': [
'oneday02.oneday02',
'oneday02',
],
}
| Python |
#!/usr/bin/python
codebase = {
'name': 'isgrid0',
'version': '0.0.0.1',
'files': [
'isgrid0/__init__.py',
'isgrid0/isgrid0.py',
],
'modules': [
'isgrid0.isgrid0',
'isgrid0',
],
}
| Python |
#!/usr/bin/python
codebase = {
'name': 'uipreducer01',
'version': '0.0.0.1',
'files': [
'uipreducer01/__init__.py',
'uipreducer01/uipreducer01.py',
],
'modules': [
'uipreducer01.uipreducer01',
'uipreducer01',
],
}
| Python |
import threading, Queue
import os, random, time
from o3grid import job, constants as CC
from o3grid.protocol import O3Channel, O3Space, O3Call
from o3grid.utility import cout, D as _D, D2 as _D2, DE as _E
from fastmap import inetstr2int as inet2int, _dumps, _loads
import o3lib.base
from o3lib.fs import StartO3EntityR... | Python |
#!/usr/bin/python
codebase = {
'name': 'uipreducer01',
'version': '0.0.0.1',
'files': [
'uipreducer01/__init__.py',
'uipreducer01/uipreducer01.py',
],
'modules': [
'uipreducer01.uipreducer01',
'uipreducer01',
],
}
| Python |
#!/usr/bin/python
codebase = {
'name': 'oneday01',
'version': '0.0.0.1',
'files': [
'oneday01/__init__.py',
'oneday01/oneday01.py',
],
'modules': [
'oneday01.oneday01',
'oneday01',
],
}
| Python |
#!/usr/bin/python
from o3grid.utility import cout
class IsGrid0Job(object):
def run(self):
cout("I'm iSGrid0.Job")
cout("Load IsGrid0.IsGrid0")
def generateJob(jobinfo, workspace):
return IsGrid0Job()
| Python |
#!/usr/bin/python
from o3grid.utility import cout
class IsGrid0Job(object):
def run(self):
cout("I'm iSGrid0.Job")
cout("Load IsGrid0.IsGrid0")
def generateJob(jobinfo, workspace):
return IsGrid0Job()
| Python |
import threading, Queue
import os, random, time
import struct, zlib
import cPickle as pickle, cStringIO as StringIO
import operator, heapq
from o3grid import constants as CC
from o3grid.utility import cout, D as _D, D2 as _D2, DE as _E
from o3grid.protocol import O3Call, O3Channel, O3Space
from o3grid import job
impo... | Python |
#!/usr/bin/python
codebase = {
'name': 'oneday02',
'version': '0.0.0.1',
'files': [
'oneday02/__init__.py',
'oneday02/oneday02.py',
],
'modules': [
'oneday02.oneday02',
'oneday02',
],
}
| Python |
import wx
class MainFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None)
self.menubar = wx.MenuBar()
self.file = wx.Menu()
self.file.Append(wx.ID_ANY,'&Test')
self.menubar.Append(self.file,'File')
self.SetMenuBar(self.menubar)
self.Show... | Python |
import MySQLdb
import time
import random
import operator
db=MySQLdb.connect(host="localhost",user="root", passwd="",db="phone_tracker")
c=db.cursor()
c.executemany(""" TRUNCATE TABLE `resultset-location`""",[()])
long = 1
lat = 1
x = 3
y = 4
i = 0
for y in range(1,y+1):
for x in range(1,x+1):
... | Python |
import MySQLdb
import time
import random
import operator
class sniffer:
def __init__(self):
self.db=MySQLdb.connect(host="localhost",user="root", passwd="",db="phone_tracker")
self.db.query("""SELECT * FROM `resultset-location`""")
r=self.db.use_result()
self.sniffer = []
... | Python |
#!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based (somewhat) on the
good old 'SimpleOSC' implementation by Daniel Holth & Clinton McChesney.
This implementation is intended to still be 'Simple' to the user, but much more complete
(with OSCServer & OSCClient classes)... | Python |
#!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based (somewhat) on the
good old 'SimpleOSC' implementation by Daniel Holth & Clinton McChesney.
This implementation is intended to still be 'Simple' to the user, but much more complete
(with OSCServer & OSCClient classes)... | Python |
# Copyright (c) 2012 eagleonhill(qiuc12@gmail.com). All rights reserved.
# Use of this source code is governed by a Mozilla-1.1 license that can be
# found in the LICENSE file.
import googlecode_upload
import tempfile
import urllib2
import optparse
import os
extensionid = 'lgllffgicojgllpmdbemgglaponefajn'
... | Python |
import subprocess
import tempfile
import shutil
import os
import codecs
import json
import zipfile
class Packer:
def __init__(self, input_path, outputfile):
self.input_path = os.path.abspath(input_path)
self.outputfile = os.path.abspath(outputfile)
self.tmppath = None
def pack(self):
... | Python |
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | Python |
maxVf = 200
# Generating the header
head = """// Copyright qiuc12@gmail.com
// This file is generated autmatically by python. DONT MODIFY IT!
#pragma once
#include <OleAuto.h>
class FakeDispatcher;
HRESULT DualProcessCommand(int commandId, FakeDispatcher *disp, ...);
extern "C" void DualProcessCommandWrap()... | Python |
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/license... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.