code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
#This contains global definition of Browser class and other useful thing ####################################################################################### # # # File: browser_bogus.py ...
[ [ 1, 0, 0.7333, 0.0222, 0, 0.66, 0, 345, 0, 1, 0, 0, 345, 0, 0 ], [ 1, 0, 0.7556, 0.0222, 0, 0.66, 0.5, 591, 0, 1, 0, 0, 591, 0, 0 ], [ 3, 0, 0.9, 0.2222, 0, 0.66, ...
[ "import urllib2", "import cookielib", "class Browser():\n def __init__(self, user, passwd, user_agent=\"Python-urllib/2.7\"):\n self.username = user\n self.password = passwd\n self.user_agent = user_agent\n self.cookie = cookielib.CookieJar()\n self.urlOpener = urllib2.buil...
#! /usr/bin/python ####################################################################################### # # # File: ad_auto.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.2011, 0.0057, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.2126, 0.0057, 0, 0.66, 0.0526, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.2184, 0.0057, 0, ...
[ "import time", "import urllib", "import urllib2", "from browser_bogus import Browser", "account_list = {\"\":\"\",\n \"\":\"\"}", "cycle = 1", "delay = 3600 * 5", "siteurl = \"http://bbs.9gal.com\"", "login_page = \"login.php\"", "star1_page = \"kf_star_1.php\"", "logout_hint = \"...
####################################################################################### # # # File: gojuon.py # # Part of 2dgal-cheater ...
[ [ 14, 0, 0.568, 0.868, 0, 0.66, 0, 833, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "gojuon = {\n\t\"=%A4%A2\":\"a\",\n\t\"=%A5%A2\":\"a\",\n\t\"=%A4%A4\":\"i\",\n\t\"=%A5%A4\":\"i\",\n\t\"=%A4%A6\":\"u\",\n\t\"=%A5%A6\":\"u\",\n\t\"=%A4%A8\":\"e\"," ]
# -*- coding: utf-8 -*- ####################################################################################### # # # File: Core.py # # Part of 2dgal_cheater ...
[ [ 8, 0, 0.0801, 0.0121, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0874, 0.0024, 0, 0.66, 0.1111, 616, 0, 1, 0, 0, 616, 0, 0 ], [ 1, 0, 0.0922, 0.0024, 0, 0.66...
[ "'''\nCreated on May 22, 2011\n\n@author: flyxian\n'''", "import operator", "from PyQt4.QtCore import *", "from PyQt4.QtGui import *", "from MainDialog import *", "try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s", " _fromUtf8 = QtCore.QString.fromUtf...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'MainDialog.ui' # # Created: Sat Jul 02 23:35:22 2011 # by: PyQt4 UI code generator 4.8.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8...
[ [ 1, 0, 0.0606, 0.0061, 0, 0.66, 0, 154, 0, 2, 0, 0, 154, 0, 0 ], [ 7, 0, 0.0818, 0.0242, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 0 ], [ 14, 1, 0.0788, 0.0061, 1, 0.21, ...
[ "from PyQt4 import QtCore, QtGui", "try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s", " _fromUtf8 = QtCore.QString.fromUtf8", " _fromUtf8 = lambda s: s", "class Ui_MainDialog(object):\n def setupUi(self, MainDialog):\n MainDialog.setObjectNa...
####################################################################################### # # File: user_agent_lib # Part of stage1st-cheater # Home: http://stage1st-cheater.googlecode.com # #...
[ [ 8, 0, 0.0082, 0.0012, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.009, 0.0002, 0, 0.66, 0.1111, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.01, 0.0012, 0, 0.66, ...
[ "'''\nCreated on May 29, 2011\n\n@author: flyxian\n'''", "import random", "UA_MSIE10 = [\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)\",\n\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)\",\n\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)\",\n\"Mo...
#! /usr/bin/python ####################################################################################### # # # File: ad_auto.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.2011, 0.0057, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.2126, 0.0057, 0, 0.66, 0.0526, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.2184, 0.0057, 0, ...
[ "import time", "import urllib", "import urllib2", "from browser_bogus import Browser", "account_list = {\"\":\"\",\n \"\":\"\"}", "cycle = 1", "delay = 3600 * 5", "siteurl = \"http://bbs.9gal.com\"", "login_page = \"login.php\"", "star1_page = \"kf_star_1.php\"", "logout_hint = \"...
#! /usr/bin/python ####################################################################################### # # # File: gojuon_gen.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.6364, 0.0182, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 14, 0, 0.6727, 0.0182, 0, 0.66, 0.1667, 107, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.6909, 0.0182, 0, ...
[ "import urllib", "file = open(\"gojuon.csv\", \"r\")", "lines = file.readlines()", "file.close()", "file = open(\"gojuon.py\", \"w\")", "for line in lines:\n items = line.strip().split(\",\")\n hiragana = urllib.urlencode({\"\":items[0]})\n katakana = urllib.urlencode({\"\":items[1]})\n phonet...
#! /usr/bin/python from distutils.core import setup import py2exe import main from glob import glob data_files = [("Microsoft.VC100.CRT", glob(r'D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\x86\Microsoft.VC100.CRT\*.*'))] setup( options = {"py2exe": {"optimize": 2,...
[ [ 1, 0, 0.1154, 0.0385, 0, 0.66, 0, 152, 0, 1, 0, 0, 152, 0, 0 ], [ 1, 0, 0.1538, 0.0385, 0, 0.66, 0.2, 768, 0, 1, 0, 0, 768, 0, 0 ], [ 1, 0, 0.1923, 0.0385, 0, 0.6...
[ "from distutils.core import setup", "import py2exe", "import main", "from glob import glob", "data_files = [(\"Microsoft.VC100.CRT\", \n glob(r'D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\redist\\x86\\Microsoft.VC100.CRT\\*.*'))]", "setup(\n options = {\"py2exe\": {\"opti...
#! /usr/bin/python from distutils.core import setup import py2exe import main from glob import glob data_files = [("Microsoft.VC100.CRT", glob(r'D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\x86\Microsoft.VC100.CRT\*.*'))] setup( options = {"py2exe": {"optimize": 2,...
[ [ 1, 0, 0.1154, 0.0385, 0, 0.66, 0, 152, 0, 1, 0, 0, 152, 0, 0 ], [ 1, 0, 0.1538, 0.0385, 0, 0.66, 0.2, 768, 0, 1, 0, 0, 768, 0, 0 ], [ 1, 0, 0.1923, 0.0385, 0, 0.6...
[ "from distutils.core import setup", "import py2exe", "import main", "from glob import glob", "data_files = [(\"Microsoft.VC100.CRT\", \n glob(r'D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\redist\\x86\\Microsoft.VC100.CRT\\*.*'))]", "setup(\n options = {\"py2exe\": {\"opti...
#! /usr/bin/python ####################################################################################### # # # File: gojuon_gen.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.6364, 0.0182, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 14, 0, 0.6727, 0.0182, 0, 0.66, 0.1667, 107, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.6909, 0.0182, 0, ...
[ "import urllib", "file = open(\"gojuon.csv\", \"r\")", "lines = file.readlines()", "file.close()", "file = open(\"gojuon.py\", \"w\")", "for line in lines:\n items = line.strip().split(\",\")\n hiragana = urllib.urlencode({\"\":items[0]})\n katakana = urllib.urlencode({\"\":items[1]})\n phonet...
#This contains global definition of Browser class and other useful thing ####################################################################################### # # # File: browser_bogus.py ...
[ [ 1, 0, 0.75, 0.0227, 0, 0.66, 0, 345, 0, 1, 0, 0, 345, 0, 0 ], [ 1, 0, 0.7727, 0.0227, 0, 0.66, 0.5, 591, 0, 1, 0, 0, 591, 0, 0 ], [ 3, 0, 0.9091, 0.2045, 0, 0.66,...
[ "import urllib2", "import cookielib", "class Browser():\n def __init__(self, user, passwd):\n self.username = user\n self.password = passwd\n self.cookie = cookielib.CookieJar()\n self.urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookie))\n self.logout_...
#! /usr/bin/python ####################################################################################### # # # File: ad_auto.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.2448, 0.007, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.2587, 0.007, 0, 0.66, 0.0667, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.2657, 0.007, 0, 0.6...
[ "import time", "import urllib", "import urllib2", "from browser_bogus import Browser", "account_list = {\"\":\"\",\n \"\":\"\"}", "cycle = 1", "delay = 3600 * 5", "siteurl = \"http://bbs.2dgal.com\"", "login_page = \"login.php\"", "star1_page = \"kf_star_1.php\"", "ad_char = \"diy...
####################################################################################### # # # File: gojuon.py # # Part of 2dgal-cheater ...
[ [ 14, 0, 0.568, 0.868, 0, 0.66, 0, 833, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "gojuon = {\n\t\"=%A4%A2\":\"a\",\n\t\"=%A5%A2\":\"a\",\n\t\"=%A4%A4\":\"i\",\n\t\"=%A5%A4\":\"i\",\n\t\"=%A4%A6\":\"u\",\n\t\"=%A5%A6\":\"u\",\n\t\"=%A4%A8\":\"e\"," ]
#! /usr/bin/python ####################################################################################### # # # File: ad_auto.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.2448, 0.007, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.2587, 0.007, 0, 0.66, 0.0667, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.2657, 0.007, 0, 0.6...
[ "import time", "import urllib", "import urllib2", "from browser_bogus import Browser", "account_list = {\"\":\"\",\n \"\":\"\"}", "cycle = 1", "delay = 3600 * 5", "siteurl = \"http://bbs.2dgal.com\"", "login_page = \"login.php\"", "star1_page = \"kf_star_1.php\"", "ad_char = \"diy...
#! /usr/bin/python ####################################################################################### # # # File: gojuon_gen.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.6364, 0.0182, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 14, 0, 0.6727, 0.0182, 0, 0.66, 0.1667, 107, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.6909, 0.0182, 0, ...
[ "import urllib", "file = open(\"gojuon.csv\", \"r\")", "lines = file.readlines()", "file.close()", "file = open(\"gojuon.py\", \"w\")", "for line in lines:\n items = line.strip().split(\",\")\n hiragana = urllib.urlencode({\"\":items[0]})\n katakana = urllib.urlencode({\"\":items[1]})\n phonet...
#! /usr/bin/python ####################################################################################### # # # File: gojuon_gen.py # # Part of 2dgal-cheater ...
[ [ 1, 0, 0.6364, 0.0182, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 14, 0, 0.6727, 0.0182, 0, 0.66, 0.1667, 107, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.6909, 0.0182, 0, ...
[ "import urllib", "file = open(\"gojuon.csv\", \"r\")", "lines = file.readlines()", "file.close()", "file = open(\"gojuon.py\", \"w\")", "for line in lines:\n items = line.strip().split(\",\")\n hiragana = urllib.urlencode({\"\":items[0]})\n katakana = urllib.urlencode({\"\":items[1]})\n phonet...
import unittest import bots.inmessage as inmessage import bots.botslib as botslib import bots.botsinit as botsinit import utilsunit '''plugin unitinmessageedifact.zip''' class TestInmessage(unittest.TestCase): def testEdifact0401(self): ''' 0401 Errors in records''' self.assertRaises(botslib.InMe...
[ [ 1, 0, 0.0115, 0.0115, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.023, 0.0115, 0, 0.66, 0.1429, 855, 0, 1, 0, 0, 855, 0, 0 ], [ 1, 0, 0.0345, 0.0115, 0, 0.6...
[ "import unittest", "import bots.inmessage as inmessage", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "import utilsunit", "'''plugin unitinmessageedifact.zip'''", "class TestInmessage(unittest.TestCase):\n def testEdifact0401(self):\n ''' 0401\tErrors in records'''\n ...
#!/usr/bin/env python from bots import engine if __name__ == '__main__': engine.start()
[ [ 1, 0, 0.4, 0.2, 0, 0.66, 0, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 4, 0, 0.9, 0.4, 0, 0.66, 1, 0, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.2, 1, 0.7, 0, 511, 3, ...
[ "from bots import engine", "if __name__ == '__main__':\n engine.start()", " engine.start()" ]
import os import sys from distutils.core import setup from distutils.command.install import INSTALL_SCHEMES #install data file in the same way as *.py for scheme in INSTALL_SCHEMES.values(): scheme['data'] = scheme['purelib'] def fullsplit(path, result=None): """ Split a pathname into components (the op...
[ [ 1, 0, 0.0122, 0.0122, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0244, 0.0122, 0, 0.66, 0.1, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0366, 0.0122, 0, 0.6...
[ "import os", "import sys", "from distutils.core import setup", "from distutils.command.install import INSTALL_SCHEMES", "for scheme in INSTALL_SCHEMES.values():\n scheme['data'] = scheme['purelib']", " scheme['data'] = scheme['purelib']", "def fullsplit(path, result=None):\n \"\"\"\n Split a...
import os import sys from distutils.core import setup from distutils.command.install import INSTALL_SCHEMES #install data file in the same way as *.py for scheme in INSTALL_SCHEMES.values(): scheme['data'] = scheme['purelib'] def fullsplit(path, result=None): """ Split a pathname into components (the op...
[ [ 1, 0, 0.0122, 0.0122, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0244, 0.0122, 0, 0.66, 0.1, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0366, 0.0122, 0, 0.6...
[ "import os", "import sys", "from distutils.core import setup", "from distutils.command.install import INSTALL_SCHEMES", "for scheme in INSTALL_SCHEMES.values():\n scheme['data'] = scheme['purelib']", " scheme['data'] = scheme['purelib']", "def fullsplit(path, result=None):\n \"\"\"\n Split a...
#!/usr/bin/env python from bots import xml2botsgrammar if __name__=='__main__': xml2botsgrammar.start()
[ [ 1, 0, 0.4, 0.2, 0, 0.66, 0, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 4, 0, 0.9, 0.4, 0, 0.66, 1, 0, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.2, 1, 0.32, 0, 511, 3, ...
[ "from bots import xml2botsgrammar", "if __name__=='__main__':\n xml2botsgrammar.start()", " xml2botsgrammar.start()" ]
import os import unittest import shutil import bots.inmessage as inmessage import bots.outmessage as outmessage import filecmp try: import json as simplejson except ImportError: import simplejson import bots.botslib as botslib import bots.botsinit as botsinit import utilsunit ''' pluging unitinisout.zip''' c...
[ [ 1, 0, 0.0067, 0.0067, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0133, 0.0067, 0, 0.66, 0.0667, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.02, 0.0067, 0, 0.66...
[ "import os", "import unittest", "import shutil", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "import filecmp", "try:\n import json as simplejson\nexcept ImportError:\n import simplejson", " import json as simplejson", " import simplejson", "import bots...
#!/usr/bin/env python from bots import grammarcheck if __name__=='__main__': grammarcheck.start()
[ [ 1, 0, 0.4, 0.2, 0, 0.66, 0, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 4, 0, 0.9, 0.4, 0, 0.66, 1, 0, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.2, 1, 0.49, 0, 511, 3, ...
[ "from bots import grammarcheck", "if __name__=='__main__':\n grammarcheck.start()", " grammarcheck.start()" ]
import os import sys from distutils.core import setup def fullsplit(path, result=None): """ Split a pathname into components (the opposite of os.path.join) in a platform-neutral way. """ if result is None: result = [] head, tail = os.path.split(path) if head == '': ret...
[ [ 1, 0, 0.0122, 0.0122, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0244, 0.0122, 0, 0.66, 0.1111, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0366, 0.0122, 0, ...
[ "import os", "import sys", "from distutils.core import setup", "def fullsplit(path, result=None):\n \"\"\"\n Split a pathname into components (the opposite of os.path.join) in a\n platform-neutral way.\n \"\"\"\n if result is None:\n result = []\n head, tail = os.path.split(path)", ...
#!/usr/bin/env python if __name__ == '__main__': import cProfile cProfile.run('from bots import engine; engine.start()','profile.tmp') import pstats p = pstats.Stats('profile.tmp') #~ p.sort_stats('cumulative').print_stats(25) p.sort_stats('time').print_stats(25) #~ p.print_callees('deepcop...
[ [ 4, 0, 0.5, 0.6429, 0, 0.66, 0, 0, 0, 0, 0, 0, 0, 0, 5 ], [ 1, 1, 0.2857, 0.0714, 1, 0.9, 0, 686, 0, 1, 0, 0, 686, 0, 0 ], [ 8, 1, 0.3571, 0.0714, 1, 0.9, 0.2,...
[ "if __name__ == '__main__':\n import cProfile\n cProfile.run('from bots import engine; engine.start()','profile.tmp')\n import pstats\n p = pstats.Stats('profile.tmp')\n #~ p.sort_stats('cumulative').print_stats(25)\n p.sort_stats('time').print_stats(25)\n #~ p.print_callees('deepcopy').print_s...
import os import unittest import shutil import bots.inmessage as inmessage import bots.outmessage as outmessage import filecmp import bots.botslib as botslib import bots.botsinit as botsinit import utilsunit ''' pluging unitinmessagexml.zip''' class TestInmessage(unittest.TestCase): ''' Read messages; some shoul...
[ [ 1, 0, 0.0036, 0.0036, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0073, 0.0036, 0, 0.66, 0.0833, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0109, 0.0036, 0, 0....
[ "import os", "import unittest", "import shutil", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "import filecmp", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "import utilsunit", "''' pluging unitinmessagexml.zip'''", "class TestInmessage(u...
#!/usr/bin/env python from bots import webserver if __name__ == '__main__': webserver.start()
[ [ 1, 0, 0.4, 0.2, 0, 0.66, 0, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 4, 0, 0.9, 0.4, 0, 0.66, 1, 0, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.2, 1, 0.21, 0, 511, 3, ...
[ "from bots import webserver", "if __name__ == '__main__':\n webserver.start()", " webserver.start()" ]
import filecmp import glob import shutil import os import sys import subprocess import logging import logging import bots.botslib as botslib import bots.botsinit as botsinit import bots.botsglobal as botsglobal from bots.botsconfig import * '''plugin unitretry.zip''' #!!!activate rotues ''' input: mime (complex struc...
[ [ 1, 0, 0.0081, 0.0081, 0, 0.66, 0, 891, 0, 1, 0, 0, 891, 0, 0 ], [ 1, 0, 0.0161, 0.0081, 0, 0.66, 0.0556, 958, 0, 1, 0, 0, 958, 0, 0 ], [ 1, 0, 0.0242, 0.0081, 0, ...
[ "import filecmp", "import glob", "import shutil", "import os", "import sys", "import subprocess", "import logging", "import logging", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "import bots.botsglobal as botsglobal", "from bots.botsconfig import *", "'''plugin unit...
import unittest import bots.botslib as botslib import bots.botsinit as botsinit import bots.grammar as grammar import bots.inmessage as inmessage import bots.outmessage as outmessage import utilsunit ''' plugin unitgrammar.zip ''' class TestGrammar(unittest.TestCase): def testgeneralgrammarerrors(self): ...
[ [ 1, 0, 0.0044, 0.0044, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0088, 0.0044, 0, 0.66, 0.1111, 816, 0, 1, 0, 0, 816, 0, 0 ], [ 1, 0, 0.0132, 0.0044, 0, 0....
[ "import unittest", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "import bots.grammar as grammar", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "import utilsunit", "''' plugin unitgrammar.zip '''", "class TestGrammar(unittest.TestCase):\n\n ...
import unittest import bots.botsglobal as botsglobal import bots.inmessage as inmessage import bots.botslib as botslib import bots.transform as transform import pickle import bots.botsinit as botsinit import utilsunit '''plugin unittranslateutils.zip ''' #as the max length is class TestTranslate(unittest.TestCase): ...
[ [ 1, 0, 0.0081, 0.0081, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0161, 0.0081, 0, 0.66, 0.1, 662, 0, 1, 0, 0, 662, 0, 0 ], [ 1, 0, 0.0242, 0.0081, 0, 0.66,...
[ "import unittest", "import bots.botsglobal as botsglobal", "import bots.inmessage as inmessage", "import bots.botslib as botslib", "import bots.transform as transform", "import pickle", "import bots.botsinit as botsinit", "import utilsunit", "'''plugin unittranslateutils.zip '''", "class TestTrans...
import unittest import filecmp import glob import shutil import os import subprocess import logging import utilsunit import bots.botslib as botslib import bots.botsinit as botsinit import bots.botsglobal as botsglobal from bots.botsconfig import * ''' plugin unitconfirm.zip before each run: clear transactions! ''' b...
[ [ 1, 0, 0.0052, 0.0052, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0105, 0.0052, 0, 0.66, 0.0833, 891, 0, 1, 0, 0, 891, 0, 0 ], [ 1, 0, 0.0157, 0.0052, 0, 0....
[ "import unittest", "import filecmp", "import glob", "import shutil", "import os", "import subprocess", "import logging", "import utilsunit", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "import bots.botsglobal as botsglobal", "from bots.botsconfig import *", "class T...
import unittest import bots.botslib as botslib import bots.botsinit as botsinit import bots.inmessage as inmessage import bots.outmessage as outmessage from bots.botsconfig import * import utilsunit ''' plugin unitformats ''' #python 2.6 treats -0 different. in outmessage this is adapted, for inmessage: python 2.6 do...
[ [ 1, 0, 0.001, 0.001, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0019, 0.001, 0, 0.66, 0.0833, 816, 0, 1, 0, 0, 816, 0, 0 ], [ 1, 0, 0.0029, 0.001, 0, 0.66, ...
[ "import unittest", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "from bots.botsconfig import *", "import utilsunit", "''' plugin unitformats '''", "testdummy={MPATH:'dummy for tests'}", "class Te...
from datetime import datetime from django.db import models from django.utils.translation import ugettext as _ ''' django is not excellent in generating db. But they have provided a way to customize the generated database using SQL. see bots/sql/*. ''' STATUST = [ (0, _(u'Open')), (1, _(u'Error')), (2, _(u'...
[ [ 1, 0, 0.0023, 0.0023, 0, 0.66, 0, 426, 0, 1, 0, 0, 426, 0, 0 ], [ 1, 0, 0.0046, 0.0023, 0, 0.66, 0.037, 40, 0, 1, 0, 0, 40, 0, 0 ], [ 1, 0, 0.0068, 0.0023, 0, 0.6...
[ "from datetime import datetime", "from django.db import models", "from django.utils.translation import ugettext as _", "'''\ndjango is not excellent in generating db. But they have provided a way to customize the generated database using SQL. see bots/sql/*.\n'''", "STATUST = [\n (0, _(u'Open')),\n (1...
''' Reading/lexing/parsing/splitting an edifile.''' import StringIO import time import sys try: import cPickle as pickle except: import pickle try: import cElementTree as ET except ImportError: try: import elementtree.ElementTree as ET except ImportError: try: from xml.et...
[ [ 8, 0, 0.0009, 0.0009, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0017, 0.0009, 0, 0.66, 0.0323, 609, 0, 1, 0, 0, 609, 0, 0 ], [ 1, 0, 0.0026, 0.0009, 0, 0.66...
[ "''' Reading/lexing/parsing/splitting an edifile.'''", "import StringIO", "import time", "import sys", "try:\n import cPickle as pickle\nexcept:\n import pickle", " import cPickle as pickle", " import pickle", "try:\n import cElementTree as ET\nexcept ImportError:\n try:\n imp...
codeconversions = { '351':'AAK', '35E':'AAK', '220':'ON', '224':'ON', '50E':'ON', '83':'IV', '380':'IV', '384':'IV', 'TESTIN':'TESTOUT', }
[ [ 14, 0, 0.5455, 1, 0, 0.66, 0, 543, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "codeconversions = {\n'351':'AAK',\n'35E':'AAK',\n'220':'ON',\n'224':'ON',\n'50E':'ON',\n'83':'IV',\n'380':'IV'," ]
""" Python Character Mapping Codec generated from CP1252.TXT with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. Adapted by Henk-Jan Ebbers for Bots open source EDI translator Regular UNOA: UNOA char, CR, LF and...
[ [ 8, 0, 0.0291, 0.0529, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0635, 0.0053, 0, 0.66, 0.1, 220, 0, 1, 0, 0, 220, 0, 0 ], [ 1, 0, 0.0688, 0.0053, 0, 0.66, ...
[ "\"\"\" Python Character Mapping Codec generated from CP1252.TXT with gencodec.py.\n\nWritten by Marc-Andre Lemburg (mal@lemburg.com).\n\n(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.\n(c) Copyright 2000 Guido van Rossum.\n\nAdapted by Henk-Jan Ebbers for Bots open source EDI translator", "import codecs",...
""" Python Character Mapping Codec generated from CP1252.TXT with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. Adapted by Henk-Jan Ebbers for Bots open source EDI translator Regular UNOB: UNOB char, CR, LF and...
[ [ 8, 0, 0.0291, 0.0529, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0635, 0.0053, 0, 0.66, 0.1, 220, 0, 1, 0, 0, 220, 0, 0 ], [ 1, 0, 0.0688, 0.0053, 0, 0.66, ...
[ "\"\"\" Python Character Mapping Codec generated from CP1252.TXT with gencodec.py.\n\nWritten by Marc-Andre Lemburg (mal@lemburg.com).\n\n(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.\n(c) Copyright 2000 Guido van Rossum.\n\nAdapted by Henk-Jan Ebbers for Bots open source EDI translator", "import codecs",...
import shutil import time from django.utils.translation import ugettext as _ #bots-modules import botslib import botsglobal import grammar import outmessage from botsconfig import * @botslib.log_session def mergemessages(startstatus=TRANSLATED,endstatus=MERGED,idroute=''): ''' Merges en envelopes several messages ...
[ [ 1, 0, 0.0019, 0.0019, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0039, 0.0019, 0, 0.66, 0.037, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0058, 0.0019, 0, 0...
[ "import shutil", "import time", "from django.utils.translation import ugettext as _", "import botslib", "import botsglobal", "import grammar", "import outmessage", "from botsconfig import *", "def mergemessages(startstatus=TRANSLATED,endstatus=MERGED,idroute=''):\n ''' Merges en envelopes several...
# Django settings for bots project. import os import bots #*******settings for bots error reports********************************** MANAGERS = ( #bots will send error reports to the MANAGERS ('name_manager', 'manager@domain.org'), ) #~ EMAIL_HOST = 'smtp.gmail.com' #Default: 'localhost' #~ EMAIL...
[ [ 1, 0, 0.0146, 0.0073, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0219, 0.0073, 0, 0.66, 0.0286, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 14, 0, 0.0511, 0.0219, 0, ...
[ "import os", "import bots", "MANAGERS = ( #bots will send error reports to the MANAGERS\n ('name_manager', 'manager@domain.org'),\n )", "PROJECT_PATH = os.path.abspath(os.path.dirname(bots.__file__))", "MEDIA_ROOT = PROJECT_PATH + '/'", "MEDIA_URL = ''", "ADMIN_MEDIA_PREFIX = '/media/'", "ROO...
import sys from django.utils.translation import ugettext as _ #bots-modules import communication import envelope import transform import botslib import botsglobal import preprocess from botsconfig import * @botslib.log_session def prepareretransmit(): ''' prepare the retransmittable files. Return: indication if fi...
[ [ 1, 0, 0.0037, 0.0037, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0075, 0.0037, 0, 0.66, 0.0714, 389, 0, 1, 0, 0, 389, 0, 0 ], [ 1, 0, 0.0149, 0.0037, 0, ...
[ "import sys", "from django.utils.translation import ugettext as _", "import communication", "import envelope", "import transform", "import botslib", "import botsglobal", "import preprocess", "from botsconfig import *", "def prepareretransmit():\n ''' prepare the retransmittable files. Return: i...
import time import django import models import viewlib import botslib import botsglobal django.contrib.admin.widgets.AdminSplitDateTime HiddenInput = django.forms.widgets.HiddenInput DEFAULT_ENTRY = ('',"---------") editypelist=[DEFAULT_ENTRY] + sorted(models.EDITYPES) confirmtypelist=[DEFAULT_ENTRY] + models.CONFIRMTY...
[ [ 1, 0, 0.0046, 0.0046, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0093, 0.0046, 0, 0.66, 0.0294, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 1, 0, 0.0139, 0.0046, 0, ...
[ "import time", "import django", "import models", "import viewlib", "import botslib", "import botsglobal", "django.contrib.admin.widgets.AdminSplitDateTime", "HiddenInput = django.forms.widgets.HiddenInput", "DEFAULT_ENTRY = ('',\"---------\")", "editypelist=[DEFAULT_ENTRY] + sorted(models.EDITYPES...
'''module contains the functions to be called from user scripts''' try: import cPickle as pickle except: import pickle import copy import collections from django.utils.translation import ugettext as _ #bots-modules import botslib import botsglobal import inmessage import outmessage from botsconfig import * #**...
[ [ 8, 0, 0.0026, 0.0026, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 7, 0, 0.009, 0.0103, 0, 0.66, 0.025, 0, 0, 1, 0, 0, 0, 0, 0 ], [ 1, 1, 0.0078, 0.0026, 1, 0.24, ...
[ "'''module contains the functions to be called from user scripts'''", "try:\n import cPickle as pickle\nexcept:\n import pickle", " import cPickle as pickle", " import pickle", "import copy", "import collections", "from django.utils.translation import ugettext as _", "import botslib", "i...
import os import sys import atexit import traceback import logging #import bots-modules import bots.botslib as botslib import bots.botsglobal as botsglobal def showusage(): print ' Update existing bots database for new release 1.6.0' print ' Options:' print " -c<directory> directory for conf...
[ [ 1, 0, 0.0096, 0.0096, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0192, 0.0096, 0, 0.66, 0.125, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0288, 0.0096, 0, 0...
[ "import os", "import sys", "import atexit", "import traceback", "import logging", "import bots.botslib as botslib", "import bots.botsglobal as botsglobal", "def showusage():\n print(' Update existing bots database for new release 1.6.0')\n print(' Options:')\n print(\" -c<directo...
from django.conf.urls.defaults import * from django.contrib import admin,auth from django.views.generic.simple import redirect_to from django.contrib.auth.decorators import login_required,user_passes_test from bots import views admin.autodiscover() staff_required = user_passes_test(lambda u: u.is_staff) superuser_requ...
[ [ 1, 0, 0.025, 0.025, 0, 0.66, 0, 341, 0, 1, 0, 0, 341, 0, 0 ], [ 1, 0, 0.05, 0.025, 0, 0.66, 0.1111, 302, 0, 2, 0, 0, 302, 0, 0 ], [ 1, 0, 0.075, 0.025, 0, 0.66, ...
[ "from django.conf.urls.defaults import *", "from django.contrib import admin,auth", "from django.views.generic.simple import redirect_to", "from django.contrib.auth.decorators import login_required,user_passes_test", "from bots import views", "admin.autodiscover()", "staff_required = user_passes_test(la...
from django import template register = template.Library() @register.filter def url2path(value): if value.startswith('/admin/bots/'): value = value[12:] else: value = value[1:] if value: if value[-1] == '/': value = value[:-1] else: value = 'home' return ...
[ [ 1, 0, 0.0588, 0.0588, 0, 0.66, 0, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 14, 0, 0.1765, 0.0588, 0, 0.66, 0.5, 276, 3, 0, 0, 0, 77, 10, 1 ], [ 2, 0, 0.6471, 0.6471, 0, 0....
[ "from django import template", "register = template.Library()", "def url2path(value):\n if value.startswith('/admin/bots/'):\n value = value[12:]\n else:\n value = value[1:]\n if value:\n if value[-1] == '/':\n value = value[:-1]", " if value.startswith('/admin/bots...
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
[ [ 1, 0, 0.0426, 0.0213, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0638, 0.0213, 0, 0.66, 0.1667, 323, 0, 1, 0, 0, 323, 0, 0 ], [ 1, 0, 0.0851, 0.0213, 0, ...
[ "import os", "import optparse", "import subprocess", "import sys", "here = os.path.dirname(__file__)", "def main():\n usage = \"usage: %prog [file1..fileN]\"\n description = \"\"\"With no file paths given this script will automatically\ncompress all jQuery-based files of the admin app. Requires the ...
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
[ [ 1, 0, 0.0426, 0.0213, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0638, 0.0213, 0, 0.66, 0.1667, 323, 0, 1, 0, 0, 323, 0, 0 ], [ 1, 0, 0.0851, 0.0213, 0, ...
[ "import os", "import optparse", "import subprocess", "import sys", "here = os.path.dirname(__file__)", "def main():\n usage = \"usage: %prog [file1..fileN]\"\n description = \"\"\"With no file paths given this script will automatically\ncompress all jQuery-based files of the admin app. Requires the ...
''' code found at code.djangoproject.com/ticket/3777 ''' from django import http class FilterPersistMiddleware(object): def _get_default(self, key): """ Gets any set default filters for the admin. Returns None if no default is set. """ default = None #~ default = settings.ADM...
[ [ 8, 0, 0.025, 0.0375, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.05, 0.0125, 0, 0.66, 0.3333, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 3, 0, 0.4188, 0.675, 0, 0.66, ...
[ "'''\ncode found at code.djangoproject.com/ticket/3777\n'''", "from django import http", "class FilterPersistMiddleware(object):\n\n def _get_default(self, key):\n \"\"\" Gets any set default filters for the admin. Returns None if no \n default is set. \"\"\"\n default = None\n ...
import time import sys try: import cPickle as pickle except: import pickle import decimal NODECIMAL = decimal.Decimal(1) try: import cElementTree as ET #~ print 'imported cElementTree' except ImportError: try: import elementtree.ElementTree as ET #~ print 'imported elementtree.Elemen...
[ [ 1, 0, 0.0012, 0.0012, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0025, 0.0012, 0, 0.66, 0.0312, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 7, 0, 0.0056, 0.005, 0, 0...
[ "import time", "import sys", "try:\n import cPickle as pickle\nexcept:\n import pickle", " import cPickle as pickle", " import pickle", "import decimal", "NODECIMAL = decimal.Decimal(1)", "try:\n import cElementTree as ET\n #~ print 'imported cElementTree'\nexcept ImportError:\n t...
import os import glob import time import datetime import stat import shutil from django.utils.translation import ugettext as _ #bots modules import botslib import botsglobal from botsconfig import * def cleanup(): ''' public function, does all cleanup of the database and file system.''' try: _cleanups...
[ [ 1, 0, 0.008, 0.008, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.016, 0.008, 0, 0.66, 0.0625, 958, 0, 1, 0, 0, 958, 0, 0 ], [ 1, 0, 0.024, 0.008, 0, 0.66, ...
[ "import os", "import glob", "import time", "import datetime", "import stat", "import shutil", "from django.utils.translation import ugettext as _", "import botslib", "import botsglobal", "from botsconfig import *", "def cleanup():\n ''' public function, does all cleanup of the database and fi...
#Globals used by Bots incommunicate = False #used to set all incommunication off db = None #db-object ini = None #ini-file-object that is read (bots.ini) routeid = '' #current route. This is used to set routeid for Processes. preprocessnumber = 0 #different preprocessnumbers ...
[ [ 14, 0, 0.2222, 0.1111, 0, 0.66, 0, 483, 1, 0, 0, 0, 0, 4, 0 ], [ 14, 0, 0.3333, 0.1111, 0, 0.66, 0.1667, 761, 1, 0, 0, 0, 0, 9, 0 ], [ 14, 0, 0.4444, 0.1111, 0, 0...
[ "incommunicate = False #used to set all incommunication off", "db = None #db-object", "ini = None #ini-file-object that is read (bots.ini)", "routeid = '' #current route. This is used to set routeid for Processes.", "preprocessnumber = 0 #different preprocessnumbe...
import copy from django.utils.translation import ugettext as _ import botslib import botsglobal from botsconfig import * def grammarread(editype,grammarname): ''' dispatch function for class Grammar or subclass read whole grammar ''' try: classtocall = globals()[editype] except KeyError...
[ [ 1, 0, 0.0012, 0.0012, 0, 0.66, 0, 739, 0, 1, 0, 0, 739, 0, 0 ], [ 1, 0, 0.0023, 0.0012, 0, 0.66, 0.0476, 389, 0, 1, 0, 0, 389, 0, 0 ], [ 1, 0, 0.0035, 0.0012, 0, ...
[ "import copy", "from django.utils.translation import ugettext as _", "import botslib", "import botsglobal", "from botsconfig import *", "def grammarread(editype,grammarname):\n ''' dispatch function for class Grammar or subclass\n read whole grammar\n '''\n try:\n classtocall = glob...
#!/usr/bin/env python import sys import os import logging from logging.handlers import TimedRotatingFileHandler from django.core.handlers.wsgi import WSGIHandler from django.utils.translation import ugettext as _ import cherrypy from cherrypy import wsgiserver import botslib import botsglobal import botsinit def showu...
[ [ 1, 0, 0.0225, 0.0112, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0337, 0.0112, 0, 0.66, 0.0769, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0449, 0.0112, 0, ...
[ "import sys", "import os", "import logging", "from logging.handlers import TimedRotatingFileHandler", "from django.core.handlers.wsgi import WSGIHandler", "from django.utils.translation import ugettext as _", "import cherrypy", "from cherrypy import wsgiserver", "import botslib", "import botsgloba...
import os import re import zipfile from django.utils.translation import ugettext as _ #bots-modules import botslib import botsglobal from botsconfig import * @botslib.log_session def preprocess(routedict,function, status=FILEIN,**argv): ''' for pre- and postprocessing of files. these are NOT translations; ...
[ [ 1, 0, 0.0031, 0.0031, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0061, 0.0031, 0, 0.66, 0.0833, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0092, 0.0031, 0, ...
[ "import os", "import re", "import zipfile", "from django.utils.translation import ugettext as _", "import botslib", "import botsglobal", "from botsconfig import *", "def preprocess(routedict,function, status=FILEIN,**argv):\n ''' for pre- and postprocessing of files.\n these are NOT translat...
from django.utils.translation import ugettext as _ #bots-modules import botslib import node from botsconfig import * class Message(object): ''' abstract class; represents a edi message. is subclassed as outmessage or inmessage object. ''' def __init__(self): self.recordnumber=0 ...
[ [ 1, 0, 0.0043, 0.0043, 0, 0.66, 0, 389, 0, 1, 0, 0, 389, 0, 0 ], [ 1, 0, 0.013, 0.0043, 0, 0.66, 0.25, 484, 0, 1, 0, 0, 484, 0, 0 ], [ 1, 0, 0.0173, 0.0043, 0, 0.6...
[ "from django.utils.translation import ugettext as _", "import botslib", "import node", "from botsconfig import *", "class Message(object):\n ''' abstract class; represents a edi message.\n is subclassed as outmessage or inmessage object.\n '''\n def __init__(self):\n self.recordnumber...
import decimal import copy from django.utils.translation import ugettext as _ import botslib import botsglobal from botsconfig import * comparekey=None def nodecompare(node): global comparekey return node.get(*comparekey) class Node(object): ''' Node class for building trees in inmessage and outmessage ...
[ [ 1, 0, 0.0021, 0.0021, 0, 0.66, 0, 349, 0, 1, 0, 0, 349, 0, 0 ], [ 1, 0, 0.0042, 0.0021, 0, 0.66, 0.125, 739, 0, 1, 0, 0, 739, 0, 0 ], [ 1, 0, 0.0063, 0.0021, 0, 0...
[ "import decimal", "import copy", "from django.utils.translation import ugettext as _", "import botslib", "import botsglobal", "from botsconfig import *", "comparekey=None", "def nodecompare(node):\n global comparekey\n return node.get(*comparekey)", " return node.get(*comparekey)", "class...
import sys import os import encodings import codecs import ConfigParser import logging, logging.handlers from django.utils.translation import ugettext as _ #Bots-modules from botsconfig import * import botsglobal import botslib class BotsConfig(ConfigParser.SafeConfigParser): ''' See SafeConfigParser....
[ [ 1, 0, 0.0051, 0.0051, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0102, 0.0051, 0, 0.66, 0.0625, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0153, 0.0051, 0, ...
[ "import sys", "import os", "import encodings", "import codecs", "import ConfigParser", "import logging, logging.handlers", "from django.utils.translation import ugettext as _", "from botsconfig import *", "import botsglobal", "import botslib", "class BotsConfig(ConfigParser.SafeConfigParser):\n ...
# Django settings for bots project. import os import bots #*******settings for bots error reports********************************** MANAGERS = ( #bots will send error reports to the MANAGERS ('name_manager', 'manager@domain.org'), ) #~ EMAIL_HOST = 'smtp.gmail.com' #Default: 'localhost' #~ EMAIL...
[ [ 1, 0, 0.0146, 0.0073, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0219, 0.0073, 0, 0.66, 0.0286, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 14, 0, 0.0511, 0.0219, 0, ...
[ "import os", "import bots", "MANAGERS = ( #bots will send error reports to the MANAGERS\n ('name_manager', 'manager@domain.org'),\n )", "PROJECT_PATH = os.path.abspath(os.path.dirname(bots.__file__))", "MEDIA_ROOT = PROJECT_PATH + '/'", "MEDIA_URL = ''", "ADMIN_MEDIA_PREFIX = '/media/'", "ROO...
''' Base library for bots. Botslib should not import from other Bots-modules.''' import sys import os import codecs import traceback import subprocess import socket #to set a time-out for connections import string import urlparse import urllib import platform import django from django.utils.translation import ugettex...
[ [ 8, 0, 0.0013, 0.0013, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0025, 0.0013, 0, 0.66, 0.0116, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0038, 0.0013, 0, 0.66...
[ "''' Base library for bots. Botslib should not import from other Bots-modules.'''", "import sys", "import os", "import codecs", "import traceback", "import subprocess", "import socket #to set a time-out for connections", "import string", "import urlparse", "import urllib", "import platform", ...
""" sef2bots.py Command line params: sourcefile.sef targetfile.py Optional command line params: -seq, -struct Converts a SEF grammar into a Bots grammar. If targetfile exists (and is writeable), it will be overwritten. If -seq is specified, field names in record definitions will be sequential (TAG01, TAG...
[ [ 8, 0, 0.0375, 0.073, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0769, 0.002, 0, 0.66, 0.0333, 113, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0789, 0.002, 0, 0.66, ...
[ "\"\"\"\nsef2bots.py\n\nCommand line params: sourcefile.sef targetfile.py\n\nOptional command line params: -seq, -struct\n\nConverts a SEF grammar into a Bots grammar. If targetfile exists (and is writeable),", "MAXMAX = 99999 # for dealing with segs/groups with max '>1'", "MAXLEN = 99999 # for overly large elm...
#constants/definitions for Bots #to be used as from bots.config import * #for statust in ta: OPEN = 0 #Bots always closes transaction. OPEN is severe error ERROR = 1 #error in transaction. OK = 2 #successfull, result is 'save'. But processing has stopped: next step with error, or no next steps defined DONE ...
[ [ 14, 0, 0.0833, 0.0167, 0, 0.66, 0, 484, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.1, 0.0167, 0, 0.66, 0.0238, 88, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.1167, 0.0167, 0, 0.66,...
[ "OPEN = 0 #Bots always closes transaction. OPEN is severe error", "ERROR = 1 #error in transaction.", "OK = 2 #successfull, result is 'save'. But processing has stopped: next step with error, or no next steps defined", "DONE = 3 #successfull, and result is picked up by next step", "PROCESS =...
import django from django.contrib import admin from django.utils.translation import ugettext as _ from django.http import Http404, HttpResponse, HttpResponseRedirect from django.contrib.admin.util import unquote, flatten_fieldsets, get_deleted_objects, model_ngettext, model_format_dict from django.core.exceptions impor...
[ [ 1, 0, 0.005, 0.005, 0, 0.66, 0, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 1, 0, 0.0101, 0.005, 0, 0.66, 0.027, 302, 0, 1, 0, 0, 302, 0, 0 ], [ 1, 0, 0.0151, 0.005, 0, 0.66,...
[ "import django", "from django.contrib import admin", "from django.utils.translation import ugettext as _", "from django.http import Http404, HttpResponse, HttpResponseRedirect", "from django.contrib.admin.util import unquote, flatten_fieldsets, get_deleted_objects, model_ngettext, model_format_dict", "fro...
#bots modules import botslib import botsglobal from botsconfig import * from django.utils.translation import ugettext as _ tavars = 'idta,statust,divtext,child,ts,filename,status,idroute,fromchannel,tochannel,frompartner,topartner,frommail,tomail,contenttype,nrmessages,editype,messagetype,errortext,script' def evalua...
[ [ 1, 0, 0.0049, 0.0025, 0, 0.66, 0, 484, 0, 1, 0, 0, 484, 0, 0 ], [ 1, 0, 0.0074, 0.0025, 0, 0.66, 0.0909, 261, 0, 1, 0, 0, 261, 0, 0 ], [ 1, 0, 0.0099, 0.0025, 0, ...
[ "import botslib", "import botsglobal", "from botsconfig import *", "from django.utils.translation import ugettext as _", "tavars = 'idta,statust,divtext,child,ts,filename,status,idroute,fromchannel,tochannel,frompartner,topartner,frommail,tomail,contenttype,nrmessages,editype,messagetype,errortext,script'",...
try: from pysqlite2 import dbapi2 as sqlite #prefer external modules for pylite except ImportError: import sqlite3 as sqlite #works OK for python26 #~ #bots engine uses: #~ ''' SELECT * #~ FROM ta #~ WHERE idta=%(idta)s ''', #~ {'idta':12345}) #~ #SQLite wants: #~ ''' SELECT * #~ FROM ta...
[ [ 7, 0, 0.0472, 0.0755, 0, 0.66, 0, 0, 0, 1, 0, 0, 0, 0, 0 ], [ 1, 1, 0.0377, 0.0189, 1, 0.11, 0, 987, 0, 1, 0, 0, 987, 0, 0 ], [ 1, 1, 0.0755, 0.0189, 1, 0.11, ...
[ "try:\n from pysqlite2 import dbapi2 as sqlite #prefer external modules for pylite\nexcept ImportError:\n import sqlite3 as sqlite #works OK for python26", " from pysqlite2 import dbapi2 as sqlite #prefer external modules for pylite", " import sqlite3 as sqlite #works OK for python26", "im...
import sys import os import botsinit import botslib import grammar def showusage(): print print " Usage: %s -c<directory> <editype> <messagetype>"%os.path.basename(sys.argv[0]) print print " Checks a Bots grammar." print " Same checks are used as in translations with bots-engine." pr...
[ [ 1, 0, 0.0132, 0.0132, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0263, 0.0132, 0, 0.66, 0.125, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0395, 0.0132, 0, 0...
[ "import sys", "import os", "import botsinit", "import botslib", "import grammar", "def showusage():\n print(\" Same checks are used as in translations with bots-engine.\")\n print(\" Searches for grammar in regular place: bots/usersys/grammars/<editype>/<messagetype>.py\")\n print(\" Opt...
import sys import os import tarfile import glob import shutil import subprocess import traceback import bots.botsglobal as botsglobal def join(path,*paths): return os.path.normpath(os.path.join(path,*paths)) #****************************************************************************** #*** start ...
[ [ 1, 0, 0.0323, 0.0323, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0645, 0.0323, 0, 0.66, 0.1111, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0968, 0.0323, 0, ...
[ "import sys", "import os", "import tarfile", "import glob", "import shutil", "import subprocess", "import traceback", "import bots.botsglobal as botsglobal", "def join(path,*paths):\n return os.path.normpath(os.path.join(path,*paths))", " return os.path.normpath(os.path.join(path,*paths))", ...
import copy import os import glob import bots.inmessage as inmessage import bots.outmessage as outmessage def comparenode(node1,node2org): node2 = copy.deepcopy(node2org) if node1.record is not None and node2.record is None: print 'node2 is "None"' return False if node1.record is None and ...
[ [ 1, 0, 0.0123, 0.0123, 0, 0.66, 0, 739, 0, 1, 0, 0, 739, 0, 0 ], [ 1, 0, 0.0247, 0.0123, 0, 0.66, 0.0909, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.037, 0.0123, 0, 0...
[ "import copy", "import os", "import glob", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "def comparenode(node1,node2org):\n node2 = copy.deepcopy(node2org)\n if node1.record is not None and node2.record is None:\n print('node2 is \"None\"')\n return Fal...
import os import unittest import shutil import bots.inmessage as inmessage import bots.outmessage as outmessage import filecmp try: import json as simplejson except ImportError: import simplejson import bots.botslib as botslib import bots.botsinit as botsinit import utilsunit try: import cElementTree as ET...
[ [ 1, 0, 0.004, 0.004, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.008, 0.004, 0, 0.66, 0.0769, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.012, 0.004, 0, 0.66, ...
[ "import os", "import unittest", "import shutil", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "import filecmp", "try:\n import json as simplejson\nexcept ImportError:\n import simplejson", " import json as simplejson", " import simplejson", "import bots...
import os import unittest import shutil import filecmp import bots.inmessage as inmessage import bots.outmessage as outmessage import bots.botslib as botslib import bots.botsinit as botsinit '''plugin unitnode.zip''' class Testnode(unittest.TestCase): ''' test node.py and message.py. ''' def testedifact0...
[ [ 1, 0, 0.0075, 0.0075, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.015, 0.0075, 0, 0.66, 0.1, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0226, 0.0075, 0, 0.66, ...
[ "import os", "import unittest", "import shutil", "import filecmp", "import bots.inmessage as inmessage", "import bots.outmessage as outmessage", "import bots.botslib as botslib", "import bots.botsinit as botsinit", "'''plugin unitnode.zip'''", "class Testnode(unittest.TestCase):\n ''' test node...
#!/usr/bin/python2.6 # # Simple http server to emulate api.playfoursquare.com import logging import shutil import sys import urlparse import SimpleHTTPServer import BaseHTTPServer class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Handle playfoursquare.com requests, for testing.""" def do_GET(self...
[ [ 1, 0, 0.0588, 0.0118, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0706, 0.0118, 0, 0.66, 0.125, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0824, 0.0118, 0, 0...
[ "import logging", "import shutil", "import sys", "import urlparse", "import SimpleHTTPServer", "import BaseHTTPServer", "class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',...
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
[ [ 1, 0, 0.0201, 0.0067, 0, 0.66, 0, 426, 0, 1, 0, 0, 426, 0, 0 ], [ 1, 0, 0.0268, 0.0067, 0, 0.66, 0.0769, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0336, 0.0067, 0, ...
[ "import datetime", "import sys", "import textwrap", "import common", "from xml.dom import pulldom", "PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;", "BOOLEAN_STANZA = \"\"\"\\\n } else i...
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
[ [ 8, 0, 0.0631, 0.0991, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1261, 0.009, 0, 0.66, 0.05, 2, 0, 1, 0, 0, 2, 0, 0 ], [ 1, 0, 0.1351, 0.009, 0, 0.66, 0....
[ "\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD", "import httplib", "import os", "import re", "import sys", "import urllib", "import urllib2", "import urlparse", "import user", "from xml....
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basena...
[ [ 1, 0, 0.1111, 0.037, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1481, 0.037, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.6...
[ "import os", "import subprocess", "import sys", "BASEDIR = '../main/src/com/joelapenna/foursquare'", "TYPESDIR = '../captures/types/v1'", "captures = sys.argv[1:]", "if not captures:\n captures = os.listdir(TYPESDIR)", " captures = os.listdir(TYPESDIR)", "for f in captures:\n basename = f.split('...
#!/usr/bin/python import logging from xml.dom import minidom from xml.dom import pulldom BOOLEAN = "boolean" STRING = "String" GROUP = "Group" # Interfaces that all FoursquareTypes implement. DEFAULT_INTERFACES = ['FoursquareType'] # Interfaces that specific FoursqureTypes implement. INTERFACES = { } DEFAULT_CLA...
[ [ 1, 0, 0.0263, 0.0088, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0439, 0.0088, 0, 0.66, 0.0833, 290, 0, 1, 0, 0, 290, 0, 0 ], [ 1, 0, 0.0526, 0.0088, 0, ...
[ "import logging", "from xml.dom import minidom", "from xml.dom import pulldom", "BOOLEAN = \"boolean\"", "STRING = \"String\"", "GROUP = \"Group\"", "DEFAULT_INTERFACES = ['FoursquareType']", "INTERFACES = {\n}", "DEFAULT_CLASS_IMPORTS = [\n]", "CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP...
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
[ [ 1, 0, 0.3514, 0.0135, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3649, 0.0135, 0, 0.66, 0.1111, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.3784, 0.0135, 0, ...
[ "import os", "import re", "import tempfile", "import shutil", "ignore_pattern = re.compile('^(.svn|target|bin|classes)')", "java_pattern = re.compile('^.*\\.java')", "annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')", "def process_dir(dir):\n files = os.listdir(dir)\n for...
import time import pprint def fib6(x): if x==0 or x==1: return 1 else: return fib6(x-2)+fib6(x-1) def main(): beg = time.clock() print fib6(33) end = time.clock() return end - beg print __name__ print fib6, fib6.__code__ print fib6.__code__.co_c_function...
[ [ 1, 0, 0.0417, 0.0417, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0833, 0.0417, 0, 0.66, 0.125, 276, 0, 1, 0, 0, 276, 0, 0 ], [ 2, 0, 0.25, 0.2083, 0, 0.6...
[ "import time", "import pprint", "def fib6(x):\n if x==0 or x==1:\n return 1\n else:\n return fib6(x-2)+fib6(x-1)", " if x==0 or x==1:\n return 1\n else:\n return fib6(x-2)+fib6(x-1)", " return 1", " return fib6(x-2)+fib6(x-1)", "def main(): \n ...
# based on a Java version: # Based on original version written in BCPL by Dr Martin Richards # in 1981 at Cambridge University Computer Laboratory, England # and a C++ version derived from a Smalltalk version written by # L Peter Deutsch. # Java version: Copyright (C) 1995 Sun Microsystems, Inc. # Translation fr...
[ [ 14, 0, 0.0248, 0.0023, 0, 0.66, 0, 616, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.027, 0.0023, 0, 0.66, 0.0294, 207, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0293, 0.0023, 0, 0....
[ "I_IDLE = 1", "I_WORK = 2", "I_HANDLERA = 3", "I_HANDLERB = 4", "I_DEVA = 5", "I_DEVB = 6", "K_DEV = 1000", "K_WORK = 1001", "BUFSIZE = 4", "BUFSIZE_RANGE = range(BUFSIZE)", "class Packet(object):\n def __init__(self,l,i,k):\n self.link = l\n self.ident = i\n self.kind = ...
import t_const FPS= t_const.FPS_SERVER
[ [ 1, 0, 0.5, 0.5, 0, 0.66, 0, 855, 0, 1, 0, 0, 855, 0, 0 ], [ 14, 0, 1, 0.5, 0, 0.66, 1, 843, 7, 0, 0, 0, 0, 0, 0 ] ]
[ "import t_const", "FPS= t_const.FPS_SERVER" ]
#! /usr/bin/env python #coding=utf-8 #游戏地图事件 data = { #类型 警告 "warn01":{ "type":"Warning", "pos":(915,3380), # 坐标 "size":(100), # 范围 "zbpos":(915,2900), #出现僵尸 "zbsize":(800,400), #随机范围 "time":5000, # 持续时间 "zbshow":30, # 僵尸出现机率 }, } def get_data(id): return data.get(id) ...
[ [ 14, 0, 0.5526, 0.6316, 0, 0.66, 0, 929, 0, 0, 0, 0, 0, 6, 0 ], [ 2, 0, 0.9737, 0.1053, 0, 0.66, 1, 721, 0, 1, 1, 0, 0, 0, 1 ], [ 13, 1, 1, 0.0526, 1, 0.4, 0, ...
[ "data = {\n\t\t#类型 警告\n\t\t\"warn01\":{\n\t\t\t\"type\":\"Warning\",\n\t\t\t\"pos\":(915,3380),\t# 坐标\n\t\t\t\"size\":(100),\t# 范围\n\t\t\t\"zbpos\":(915,2900),\t#出现僵尸\n\t\t\t\"zbsize\":(800,400),\t#随机范围", "def get_data(id):\n\treturn data.get(id)", "\treturn data.get(id)" ]
#! /usr/bin/env python #coding=utf-8 import base_object import math import t_const,t_cmd import random,copy class CEvent(object): def __init__(self): self.time = 0 self.event = None pass class CMapEvent(base_object.CObject): def __init__(self, mapmgr): self.sizelist = {} self.timelist = ...
[ [ 1, 0, 0.0404, 0.0101, 0, 0.66, 0, 882, 0, 1, 0, 0, 882, 0, 0 ], [ 1, 0, 0.0505, 0.0101, 0, 0.66, 0.2, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0606, 0.0101, 0, 0.6...
[ "import base_object", "import math", "import t_const,t_cmd", "import random,copy", "class CEvent(object):\n\tdef __init__(self):\n\t\tself.time = 0\n\t\tself.event = None\n\t\tpass", "\tdef __init__(self):\n\t\tself.time = 0\n\t\tself.event = None\n\t\tpass", "\t\tself.time = 0", "\t\tself.event = Non...
#! /usr/bin/env python #coding=utf-8 import base_object import math import t_const,t_cmd import random,copy class CEvent(object): def __init__(self): self.time = 0 self.event = None pass class CMapEvent(base_object.CObject): def __init__(self, mapmgr): self.sizelist = {} self.timelist = ...
[ [ 1, 0, 0.0404, 0.0101, 0, 0.66, 0, 882, 0, 1, 0, 0, 882, 0, 0 ], [ 1, 0, 0.0505, 0.0101, 0, 0.66, 0.2, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0606, 0.0101, 0, 0.6...
[ "import base_object", "import math", "import t_const,t_cmd", "import random,copy", "class CEvent(object):\n\tdef __init__(self):\n\t\tself.time = 0\n\t\tself.event = None\n\t\tpass", "\tdef __init__(self):\n\t\tself.time = 0\n\t\tself.event = None\n\t\tpass", "\t\tself.time = 0", "\t\tself.event = Non...
#! /usr/bin/env python #coding=utf-8 #游戏地图事件 data = { #类型 警告 "warn01":{ "type":"Warning", "pos":(915,3380), # 坐标 "size":(100), # 范围 "zbpos":(915,2900), #出现僵尸 "zbsize":(800,400), #随机范围 "time":5000, # 持续时间 "zbshow":30, # 僵尸出现机率 }, } def get_data(id): return data.get(id) ...
[ [ 14, 0, 0.5526, 0.6316, 0, 0.66, 0, 929, 0, 0, 0, 0, 0, 6, 0 ], [ 2, 0, 0.9737, 0.1053, 0, 0.66, 1, 721, 0, 1, 1, 0, 0, 0, 1 ], [ 13, 1, 1, 0.0526, 1, 0.9, 0, ...
[ "data = {\n\t\t#类型 警告\n\t\t\"warn01\":{\n\t\t\t\"type\":\"Warning\",\n\t\t\t\"pos\":(915,3380),\t# 坐标\n\t\t\t\"size\":(100),\t# 范围\n\t\t\t\"zbpos\":(915,2900),\t#出现僵尸\n\t\t\t\"zbsize\":(800,400),\t#随机范围", "def get_data(id):\n\treturn data.get(id)", "\treturn data.get(id)" ]
# -*- coding: utf-8 -*- import hall_callback import t_const, t_error, t_cmd, tgame_wizard #import tgame_struct #import tgame_factroy_s import game_player_s #import tgame_sprite_config, tgame_stage_config import tgame_room import random, cPickle import tgame_mapevent_s #游戏逻辑类,单局游戏的全局数据保存在这里 class CMap(obj...
[ [ 1, 0, 0.0063, 0.0032, 0, 0.66, 0, 380, 0, 1, 0, 0, 380, 0, 0 ], [ 1, 0, 0.0095, 0.0032, 0, 0.66, 0.1667, 855, 0, 4, 0, 0, 855, 0, 0 ], [ 1, 0, 0.0189, 0.0032, 0, ...
[ "import hall_callback", "import t_const, t_error, t_cmd, tgame_wizard", "import game_player_s", "import tgame_room", "import random, cPickle", "import tgame_mapevent_s", "class CMap(object):\n\t#构造函数\n\tdef __init__(self, objRoom):\n\t\tsuper(CMap, self).__init__()\n\t\tself.objRoom = objRoom\t\t\t\t#房间...
#-- coding: utf-8 -*- import t_const """巫师指令定义方面客户端和服务端公用,其他的函数为客户端专用""" WIZARD_CHANGE_SUN = 0x01 #改变阳光数量 WIZARD_END_GAME = 0x02 #立刻结束游戏 WIZARD_ADD_ZOMBIE = 0x03 #立刻刷新僵尸 #帮助文字字典 HELP_TEXT = {WIZARD_CHANGE_SUN : "改变阳光数量指令//change_sun:参数1:整数(可正负,代表阳光数量的改变值),示例://change_sun 100", \ WIZARD_END_GAM...
[ [ 1, 0, 0.0189, 0.0094, 0, 0.66, 0, 855, 0, 1, 0, 0, 855, 0, 0 ], [ 8, 0, 0.0377, 0.0094, 0, 0.66, 0.1111, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0472, 0.0094, 0, 0.6...
[ "import t_const", "\"\"\"巫师指令定义方面客户端和服务端公用,其他的函数为客户端专用\"\"\"", "WIZARD_CHANGE_SUN\t= 0x01\t\t\t\t#改变阳光数量", "WIZARD_END_GAME\t\t= 0x02\t\t\t\t#立刻结束游戏", "WIZARD_ADD_ZOMBIE\t= 0x03\t\t\t\t#立刻刷新僵尸", "HELP_TEXT = {WIZARD_CHANGE_SUN : \"改变阳光数量指令//change_sun:参数1:整数(可正负,代表阳光数量的改变值),示例://change_sun 100\", \\\n\t\t...
# -*- coding: utf-8 -*- """以下是帧数相关配置""" FPS = 30 #客户端逻辑帧数 FPS_SERVER = 5 #服务端逻辑帧数 FPS_RATE = FPS / FPS_SERVER #客户端服务端帧率比 """以下是游戏模式相关配置""" GAME_MODE_SINGLE = 0x01 #单人模式 """以下是玩家个人数据相关的配置""" #存关卡完成情况的buff的key BUFF_COMPLETE = "buf0" #所有用到的buff的列表 ALL_USED_BUFF = (BUFF_COMPLETE, ) #存关卡完成信...
[ [ 8, 0, 0.0078, 0.0039, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0118, 0.0039, 0, 0.66, 0.0063, 843, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0157, 0.0039, 0, 0.66...
[ "\"\"\"以下是帧数相关配置\"\"\"", "FPS\t\t\t\t\t= 30\t\t\t#客户端逻辑帧数", "FPS_SERVER\t\t\t= 5\t\t#服务端逻辑帧数", "FPS_RATE\t\t\t= FPS / FPS_SERVER\t\t#客户端服务端帧率比", "\"\"\"以下是游戏模式相关配置\"\"\"", "GAME_MODE_SINGLE\t\t= 0x01\t\t#单人模式", "\"\"\"以下是玩家个人数据相关的配置\"\"\"", "BUFF_COMPLETE\t\t\t= \"buf0\"", "ALL_USED_BUFF\t\t\t= (BUF...
#! /usr/bin/env python #coding=utf-8 # 此方法用于生成寻路网格 import tgame_map import iworld2d class rect(object): def __init__(self, lu, ru, ld, rd): self.lu = lu self.ru = ru self.ld = ld self.rd = rd def init(): global g_allpos, g_allsize, possum, sizesum g_allpos = {} g_allsize = {} possum = ...
[ [ 1, 0, 0.051, 0.0102, 0, 0.66, 0, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0612, 0.0102, 0, 0.66, 0.2, 863, 0, 1, 0, 0, 863, 0, 0 ], [ 3, 0, 0.1071, 0.0612, 0, 0.66...
[ "import tgame_map", "import iworld2d", "class rect(object):\n\tdef __init__(self, lu, ru, ld, rd):\n\t\tself.lu = lu\n\t\tself.ru = ru\n\t\tself.ld = ld\n\t\tself.rd = rd", "\tdef __init__(self, lu, ru, ld, rd):\n\t\tself.lu = lu\n\t\tself.ru = ru\n\t\tself.ld = ld\n\t\tself.rd = rd", "\t\tself.lu = lu", ...
#! /usr/bin/env python #coding=utf-8 # 此方法用于生成寻路网格 import tgame_map import iworld2d class rect(object): def __init__(self, lu, ru, ld, rd): self.lu = lu self.ru = ru self.ld = ld self.rd = rd def init(): global g_allpos, g_allsize, possum, sizesum g_allpos = {} g_allsize = {} possum = ...
[ [ 1, 0, 0.051, 0.0102, 0, 0.66, 0, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0612, 0.0102, 0, 0.66, 0.2, 863, 0, 1, 0, 0, 863, 0, 0 ], [ 3, 0, 0.1071, 0.0612, 0, 0.66...
[ "import tgame_map", "import iworld2d", "class rect(object):\n\tdef __init__(self, lu, ru, ld, rd):\n\t\tself.lu = lu\n\t\tself.ru = ru\n\t\tself.ld = ld\n\t\tself.rd = rd", "\tdef __init__(self, lu, ru, ld, rd):\n\t\tself.lu = lu\n\t\tself.ru = ru\n\t\tself.ld = ld\n\t\tself.rd = rd", "\t\tself.lu = lu", ...
data = { "id0":{ "p1":(0,4099), "p2":(4099,4099), "p3":(1534,4096), "minwidth":3, "lj":["id12","id13"], }, "id1":{ "p1":(4099,4099), "p2":(4099,0), "p3":(1534,2196), "minwidth":2869, "lj":["id2","id8"], }, "id2":{ "p1":(4099,0), "p2":(0,0), "p3":(1534...
[ [ 14, 0, 0.4985, 0.9939, 0, 0.66, 0, 929, 0, 0, 0, 0, 0, 6, 0 ], [ 2, 0, 0.9985, 0.0061, 0, 0.66, 1, 721, 0, 1, 1, 0, 0, 0, 1 ], [ 13, 1, 1, 0.0031, 1, 0.67, 0,...
[ "data = {\n\t\t\"id0\":{\n\t\t\t\"p1\":(0,4099),\n\t\t\t\"p2\":(4099,4099),\n\t\t\t\"p3\":(1534,4096),\n\t\t\t\"minwidth\":3,\n\t\t\t\"lj\":[\"id12\",\"id13\"],\n\t\t\t},", "def get_data(id):\n\treturn data.get(id)", "\treturn data.get(id)" ]
data = { "id0":{ "p1":(-1,7200), "p2":(15300,7200), "p3":(6976,7190), "minwidth":11, "lj":["id8","id188"], }, "id1":{ "p1":(15300,7200), "p2":(15300,-1), "p3":(15217,3645), "minwidth":92, "lj":["id93","id189"], }, "id2":{ "p1":(15300,-1), "p2":(-1,-1), ...
[ [ 14, 0, 0.4997, 0.9988, 0, 0.66, 0, 929, 0, 0, 0, 0, 0, 6, 0 ], [ 2, 0, 0.9997, 0.0012, 0, 0.66, 1, 721, 0, 1, 1, 0, 0, 0, 1 ], [ 13, 1, 1, 0.0006, 1, 0.63, 0,...
[ "data = {\n\t\t\"id0\":{\n\t\t\t\"p1\":(-1,7200),\n\t\t\t\"p2\":(15300,7200),\n\t\t\t\"p3\":(6976,7190),\n\t\t\t\"minwidth\":11,\n\t\t\t\"lj\":[\"id8\",\"id188\"],\n\t\t\t},", "def get_data(id):\n\treturn data.get(id)", "\treturn data.get(id)" ]
#-- coding: utf-8 -*- #import tgame_stage_config, tgame_achieve_config import tgame_stage_config #房间内玩家对象类 class CPlayer(object): def __init__(self, objRoom, uid): super(CPlayer, self).__init__() self.objRoom = objRoom #房间对象的引用 self.iSide = -1 #玩家的唯一标识 self.hid = -1 #玩家的socket(其实客户端不知道) sel...
[ [ 1, 0, 0.0195, 0.0065, 0, 0.66, 0, 489, 0, 1, 0, 0, 489, 0, 0 ], [ 3, 0, 0.5162, 0.974, 0, 0.66, 1, 903, 0, 14, 0, 0, 186, 0, 12 ], [ 2, 1, 0.1234, 0.1753, 1, 0.52...
[ "import tgame_stage_config", "class CPlayer(object):\n\tdef __init__(self, objRoom, uid):\n\t\tsuper(CPlayer, self).__init__()\n\t\tself.objRoom = objRoom\t\t#房间对象的引用\n\t\tself.iSide = -1\t\t\t\t#玩家的唯一标识\n\t\tself.hid = -1\t\t\t\t\t#玩家的socket(其实客户端不知道)\n\t\tself.uid = uid\t\t\t\t#玩家的uid\n\t\tself.urs = \"\"\t\t\t...
#! /usr/bin/env python #coding=utf-8 # tgame_entity import tgame_player import tgame_map import tgame_mapmgr g_builds = {} g_entitys = {} g_phys = {} g_items = {} ET_Player = 0x01 ET_Zombie = 0x02 ET_Barrier = 0x03 ET_Other = 0x04 def init(): pass def addentity(playerinfo, AItype = None): imp...
[ [ 1, 0, 0.0645, 0.0161, 0, 0.66, 0, 17, 0, 1, 0, 0, 17, 0, 0 ], [ 1, 0, 0.0806, 0.0161, 0, 0.66, 0.0667, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0968, 0.0161, 0, 0....
[ "import tgame_player", "import tgame_map", "import tgame_mapmgr", "g_builds = {}", "g_entitys = {}", "g_phys = {}", "g_items = {}", "ET_Player = 0x01", "ET_Zombie = 0x02", "ET_Barrier = 0x03", "ET_Other = 0x04", "def init():\n\tpass", "def addentity(playerinfo, AItype = None):\n\timport tgam...
#! /usr/bin/env python #coding=utf-8 import tgame_fsm class PlayerFSMClass(tgame_fsm.IFsmCallbackObj): TransitionMap = { ('stand', 'onMove'):'move', ('move', 'stopMove'):'stand', ('stand', 'Fire'):'atk', } MapState2Look = { 'move' : 'anim_stand_clip1', 'walk' : 'anim_walk_clip1', ...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 111, 0, 1, 0, 0, 111, 0, 0 ], [ 3, 0, 0.5781, 0.875, 0, 0.66, 1, 535, 0, 5, 0, 0, 717, 0, 3 ], [ 14, 1, 0.25, 0.1562, 1, 0.57, ...
[ "import tgame_fsm", "class PlayerFSMClass(tgame_fsm.IFsmCallbackObj):\n\tTransitionMap = {\n\t\t ('stand', 'onMove'):'move',\n\t\t ('move', 'stopMove'):'stand',\n\t\t ('stand', 'Fire'):'atk',\n\t}\n\tMapState2Look = {\n\t\t 'move' : 'anim_stand_clip1',", "\tTransitionMap = {\n\t\t ('stand', 'onMove'):'...
#! /usr/bin/env python #coding=utf-8 import math3d,math LEFT_SIDE = 0x01 RIGHT_SIDE = 0x02 NONE_SIDE = 0x03 def angle(o, s, e): cosfi = 0 fi = 0 norm = 0 dsx = s[0] - o[0] dsy = s[1] - o[1] dex = e[0] - o[0] dey = e[1] - o[1] cosfi = dsx * dex + dsy * dey norm = (dsx * dsx + dsy * dsy)...
[ [ 1, 0, 0.0135, 0.0045, 0, 0.66, 0, 679, 0, 2, 0, 0, 679, 0, 0 ], [ 14, 0, 0.027, 0.0045, 0, 0.66, 0.0526, 654, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0315, 0.0045, 0, 0...
[ "import math3d,math", "LEFT_SIDE = 0x01", "RIGHT_SIDE = 0x02", "NONE_SIDE = 0x03", "def angle(o, s, e):\n\tcosfi = 0\n\tfi = 0\n\tnorm = 0\n\tdsx = s[0] - o[0]\n\tdsy = s[1] - o[1]\n\tdex = e[0] - o[0]\n\tdey = e[1] - o[1]", "\tcosfi = 0", "\tfi = 0", "\tnorm = 0", "\tdsx = s[0] - o[0]", "\tdsy = ...
#! /usr/bin/env python #coding=utf-8 # -*- coding: utf-8 -*- import log # # transitionMap = { # (fromState, event):toState, # (fromState, event):toState, # ... # } # # # class IFsmCallbackObj(object): def __init__(self): pass def OnEnterState(self, state): pass def OnLeaveState(s...
[ [ 1, 0, 0.0784, 0.0196, 0, 0.66, 0, 432, 0, 1, 0, 0, 432, 0, 0 ], [ 3, 0, 0.402, 0.2353, 0, 0.66, 0.5, 381, 0, 4, 0, 0, 186, 0, 0 ], [ 2, 1, 0.3235, 0.0392, 1, 0.43...
[ "import log", "class IFsmCallbackObj(object):\n\tdef __init__(self):\n\t\tpass\n\n\tdef OnEnterState(self, state):\n\t\tpass\n\n\tdef OnLeaveState(self, state):", "\tdef __init__(self):\n\t\tpass", "\tdef OnEnterState(self, state):\n\t\tpass", "\tdef OnLeaveState(self, state):\n\t\tpass", "\tdef OnEvent(s...
#! /usr/bin/env python #coding=utf-8 # 道具类,道具使用,效果,影响
[]
[]
#! /usr/bin/env python #coding=utf-8 # tgame_entity import tgame_player import tgame_map import tgame_mapmgr g_builds = {} g_entitys = {} g_phys = {} g_items = {} ET_Player = 0x01 ET_Zombie = 0x02 ET_Barrier = 0x03 ET_Other = 0x04 def init(): pass def addentity(playerinfo, AItype = None): imp...
[ [ 1, 0, 0.0645, 0.0161, 0, 0.66, 0, 17, 0, 1, 0, 0, 17, 0, 0 ], [ 1, 0, 0.0806, 0.0161, 0, 0.66, 0.0667, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0968, 0.0161, 0, 0....
[ "import tgame_player", "import tgame_map", "import tgame_mapmgr", "g_builds = {}", "g_entitys = {}", "g_phys = {}", "g_items = {}", "ET_Player = 0x01", "ET_Zombie = 0x02", "ET_Barrier = 0x03", "ET_Other = 0x04", "def init():\n\tpass", "def addentity(playerinfo, AItype = None):\n\timport tgam...
#! /usr/bin/env python #coding=utf-8 import tgame_fsm class PlayerFSMClass(tgame_fsm.IFsmCallbackObj): TransitionMap = { ('stand', 'onMove'):'move', ('move', 'stopMove'):'stand', ('stand', 'Fire'):'atk', } MapState2Look = { 'move' : 'anim_stand_clip1', 'walk' : 'anim_walk_clip1', ...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 111, 0, 1, 0, 0, 111, 0, 0 ], [ 3, 0, 0.5781, 0.875, 0, 0.66, 1, 535, 0, 5, 0, 0, 717, 0, 3 ], [ 14, 1, 0.25, 0.1562, 1, 0.63, ...
[ "import tgame_fsm", "class PlayerFSMClass(tgame_fsm.IFsmCallbackObj):\n\tTransitionMap = {\n\t\t ('stand', 'onMove'):'move',\n\t\t ('move', 'stopMove'):'stand',\n\t\t ('stand', 'Fire'):'atk',\n\t}\n\tMapState2Look = {\n\t\t 'move' : 'anim_stand_clip1',", "\tTransitionMap = {\n\t\t ('stand', 'onMove'):'...
#! /usr/bin/env python #coding=utf-8 # 道具类,道具使用,效果,影响
[]
[]
# 战争迷雾系统 import iworld2d import math3d # 小迷雾块大小 fogsize = 30 # 累计器 visionsum = 0 # 迷雾数量 h = 768/fogsize+1 w = 1024/fogsize+1 # 视野 class tgame_vision(object): def __init__(self, vision = 20, pos = (0,0) , mode = "pos", name = ""): # 累计器加1 global visionsum visionsum += 1 # 视野范围 self....
[ [ 1, 0, 0.021, 0.007, 0, 0.66, 0, 863, 0, 1, 0, 0, 863, 0, 0 ], [ 1, 0, 0.028, 0.007, 0, 0.66, 0.0556, 679, 0, 1, 0, 0, 679, 0, 0 ], [ 14, 0, 0.049, 0.007, 0, 0.66,...
[ "import iworld2d", "import math3d", "fogsize = 30", "visionsum = 0", "h = 768/fogsize+1", "w = 1024/fogsize+1", "class tgame_vision(object):\n\tdef __init__(self, vision = 20, pos = (0,0) , mode = \"pos\", name = \"\"):\n\t\t# 累计器加1\n\t\tglobal visionsum\n\t\tvisionsum += 1\n\t\t# 视野范围\n\t\tself.vision ...