code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
import logging
# Change default log level to debug in dev_appserver to match production
logging.getLogger().setLevel(logging.DEBUG)
# but leave the default for App Engine APIs
logging.getLogger('google.appengine').setLevel(logging.INFO)
| Python |
#!/usr/bin/env python2.7
import json
import logging
import os
import pprint as pp
import sys
import unittest
import urllib2
try:
from webtest import TestApp
except:
print """Please install webtest from http://webtest.pythonpaste.org/"""
sys.exit(1)
# Attempt to locate the App Engine SDK based on the system PAT... | Python |
import os, zipfile
def zip(target, source, env):
f = zipfile.ZipFile(str(target[0]), 'w', zipfile.ZIP_DEFLATED)
chdir = None
try:
chdir = env['ZIPCHDIR'] + os.sep
except:
pass
for s in source:
s = str(s)
if chdir and s.find(chdir) == 0:
arcname = s[len(ch... | Python |
import sys, os, string, re
platform = sys.platform
try:
FLAGS = os.environ['CXXFLAGS'];
except:
FLAGS = '-O2';
linking_options=' --libs ';
try:
DYNAMIC_LINKING = os.environ['DYNAMIC_LINKING'];
except:
linking_options=' --static '
print "linking: " + linking_options
FLAGS += ' -include xpcom-conf... | Python |
import os
Import('zipbld')
contents = []
content = 'core.js browserOverlay.xul mailOverlay.xul songOverlay.xul navigatorOverlay.xul options.xul options.js icon.png'
for c in content.split(' '):
contents.append('content' + os.sep + c)
locales = 'bg-BG ca-AD de-DE en-US es-AR es-ES fa-IR fr-FR it-IT ja-JP mk-MK nl... | Python |
import os, zipfile
def zip(target, source, env):
f = zipfile.ZipFile(str(target[0]), 'w', zipfile.ZIP_DEFLATED)
chdir = None
try:
chdir = env['ZIPCHDIR'] + os.sep
except:
pass
for s in source:
s = str(s)
if chdir and s.find(chdir) == 0:
arcname = s[len(ch... | Python |
import sys, os, string, re
platform = sys.platform
try:
FLAGS = os.environ['CXXFLAGS'];
except:
FLAGS = '-O2';
linking_options=' --libs ';
try:
DYNAMIC_LINKING = os.environ['DYNAMIC_LINKING'];
except:
linking_options=' --static '
print "linking: " + linking_options
FLAGS += ' -include xpcom-conf... | Python |
import os
Import('zipbld')
contents = []
content = 'core.js browserOverlay.xul mailOverlay.xul songOverlay.xul navigatorOverlay.xul options.xul options.js icon.png'
for c in content.split(' '):
contents.append('content' + os.sep + c)
locales = 'bg-BG ca-AD de-DE en-US es-AR es-ES fa-IR fr-FR it-IT ja-JP mk-MK nl... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import sys,cgi,re,Image,Gnuplot,string,os
sys.path+=[os.getcwd()]
from types import *
from firesocket import *
try:
form=cgi.FieldStorage()
if form.has_key("server"):
server=form["server"].value
else:
server="localhost"
if form.has_key("p... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import sys,cgi,re,Image,Gnuplot,string,os
sys.path+=[os.getcwd()]
from types import *
from firesocket import *
try:
form=cgi.FieldStorage()
if form.has_key("server"):
server=form["server"].value
else:
server="localhost"
if form.has_key("p... | Python |
#!/usr/bin/python
import sys
import cgi
import re
import Image
sys.stderr=sys.stdout
try:
form=cgi.FieldStorage()
imagefilename=form["image"].value
outWidth=-1
outHeight=-1
maxDim=-1
if(form.has_key("max")):
maxDim=int(form["max"].value)
if(form.has_key("width")):
outWidth... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#$Header$
# print cgi-header
print "Content-Type: text/html\n\n"
print
#print "<pre style=\"font-family:Fixedsys,Courier,1px;\">" # to have error messages as readable as possible, this
# is switched of right before displaying the main part of the page
... | Python |
#default settings
positiveImg="images/positive.png"
negativeImg="images/negativ.png"
neutralImg="images/neutral.png"
fireLogo="images/fire-logo.png"
i6Logo="images/i6.png"
TemplateFile = "fire-template.html"
fireServer="localhost"
firePort=12960
imgpyurl="img.py"
fireurl="fire.py"
#tempdir="/tmp"
#maxSize=1000, 1000
#m... | Python |
#!/usr/bin/python
import sys
import cgi
import re
import Image
sys.stderr=sys.stdout
try:
form=cgi.FieldStorage()
imagefilename=form["image"].value
outWidth=-1
outHeight=-1
maxDim=-1
if(form.has_key("max")):
maxDim=int(form["max"].value)
if(form.has_key("width")):
outWidth... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#$Header$
# print cgi-header
print "Content-Type: text/html\n\n"
print
#print "<pre style=\"font-family:Fixedsys,Courier,1px;\">" # to have error messages as readable as possible, this
# is switched of right before displaying the main part of the page
... | Python |
#!/usr/bin/python
import sys,re
import filelist
filelist=filelist.FileList()
filelist.load(sys.argv[1])
for i in filelist:
cls=i[1]
fname=i[0]
print fname,
for j in filelist:
if j[1]==cls and j[0]!=fname:
print j[0],
print
#print filelist
| Python |
import re,sys,string,os
class FileList:
def __init__(self):
self.files=[]
self.classes=False
self.featuredirectories=False
self.descriptions=False
self.path=""
self.rawpath=""
self.suffices=[]
self.filename2idx={}
def __str__(self):
result... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
#-----------------------------------------------------------------
s=firesocket.FIRESocket()
try:
if len(sys.argv) < 5:
print """USAGE:
makedistfiles.py <query... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
filelist=filelist.FileList()
filelist.load(sys.argv[1])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exit(10)
for i in filelist:
cls=i[1]
desc=[]
#pr... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class SparseHistogramFeature:
def __init__(self):
self.bins={}
self.data={}
self.steps=[]
self.stepSize=[]
self.min=[]
self.max=[]
self.dim=0
self.numberofBins=0
self.counter... | Python |
#------------------------------------------------------------------------------
# proxyserver implementation for communication with the web frontend and fire
# server system
# server must be reachable via network sockets in order to be of any use
#
#--------------------------------------------------------------------... | Python |
#!/usr/bin/python
from string import split, lower, strip
from random import shuffle
import sys
import os
from os.path import join, getsize
ARCH=os.environ["ARCH"]
# returns the string after a certain option string
def getStringAfter(name, array, default):
for i in range(len(array)):
if array[i] == name:
... | Python |
#!/usr/bin/python
from string import split, lower, strip
from random import shuffle
import sys
import os
from os.path import join, getsize
ARCH=os.environ["ARCH"]
# returns the string after a certain option string
def getStringAfter(name, array, default):
for i in range(len(array)):
if array[i] == name:
... | Python |
#!/usr/bin/env python
import sys,gzip
class Feature:
def __init__(self):
self.posx=0
self.posy=0
self.scale=0
self.vec=[]
class LocalFeatures:
def __init__(self):
self.winsize=0
self.dim=0
self.subsampling=0
self.padding=0
self.numberOfF... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class HistogramFeature:
def __init__(self):
self.steps=[]
self.bins=[]
self.min=[]
self.max=[]
self.stepsize=[]
self.dim=0
self.counter=0
self.filename=""
self.data=[]
d... | Python |
#!/usr/bin/python
import sys
#this script merges fire distance files.
#
# as command line parameters, arbitrary many distance files are given and
# the merged distance file is printed.
infiles=[]
line=[]
for i in sys.argv[1:]:
infiles.append(open(i,"r"))
line.append("")
line[0]=infiles[0].readline()
count=... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
querylist=filelist.FileList()
filelist=filelist.FileList()
filelist.load(sys.argv[1])
querylist.load(sys.argv[2])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exi... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback,numarray
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
server="localhost"
port=12960
database=""
qu... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
useX="-x" in sys.argv
ve... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
filelist=filelist.FileList()
filelist.load(sys.argv[1])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exit(10)
for i in filelist:
cls=i[1]
desc=[]
#pr... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class SparseHistogramFeature:
def __init__(self):
self.bins={}
self.data={}
self.steps=[]
self.stepSize=[]
self.min=[]
self.max=[]
self.dim=0
self.numberofBins=0
self.counter... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
#-----------------------------------------------------------------
s=firesocket.FIRESocket()
try:
if len(sys.argv) < 5:
print """USAGE:
makedistfiles.py <query... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
try:
time.sleep(1) #... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback
#sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
... | Python |
#!/usr/bin/python
import sys,re
import filelist
filelist=filelist.FileList()
filelist.load(sys.argv[1])
for i in filelist:
cls=i[1]
fname=i[0]
print fname,
for j in filelist:
if j[1]==cls and j[0]!=fname:
print j[0],
print
#print filelist
| Python |
#!/usr/bin/python
import sys,re,filelist
if len(sys.argv)<3:
print """USAGE filelistquery2querylist.py <querylist> <dblist>"""
sys.exit(5)
qlist=filelist.FileList()
qlist.load(sys.argv[1])
dblist=filelist.FileList()
dblist.load(sys.argv[2])
for i in qlist:
cls=i[1]
fname=i[0]
print fname,
f... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
useX="-x" in sys.argv
ve... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
import sys,re,filelist
if len(sys.argv)<3:
print """USAGE filelistquery2querylist.py <querylist> <dblist>"""
sys.exit(5)
qlist=filelist.FileList()
qlist.load(sys.argv[1])
dblist=filelist.FileList()
dblist.load(sys.argv[2])
for i in qlist:
cls=i[1]
fname=i[0]
print fname,
f... | Python |
import socket, os, sys,re
# ----------------------------------------------------------------------
# socket implementation for comunication with the server system
# running on any computer which is reachable via network sockets
# here we need mainly the functions
# * connect
# * sendcmd
# * getline
# * close
# for the... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
querylist=filelist.FileList()
filelist=filelist.FileList()
filelist.load(sys.argv[1])
querylist.load(sys.argv[2])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exi... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback
#sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class HistogramFeature:
def __init__(self):
self.steps=[]
self.bins=[]
self.min=[]
self.max=[]
self.stepsize=[]
self.dim=0
self.counter=0
self.filename=""
self.data=[]
d... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
try:
time.sleep(1) #... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback,numarray
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
server="localhost"
port=12960
database=""
qu... | Python |
#!/usr/bin/env python
import sys,gzip
class Feature:
def __init__(self):
self.posx=0
self.posy=0
self.scale=0
self.vec=[]
class LocalFeatures:
def __init__(self):
self.winsize=0
self.dim=0
self.subsampling=0
self.padding=0
self.numberOfF... | Python |
#!/usr/bin/python
import sys
#this script merges fire distance files.
#
# as command line parameters, arbitrary many distance files are given and
# the merged distance file is printed.
infiles=[]
line=[]
for i in sys.argv[1:]:
infiles.append(open(i,"r"))
line.append("")
line[0]=infiles[0].readline()
count=... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import sys,cgi,re,Image,Gnuplot,string,os
sys.path+=[os.getcwd()]
from types import *
from firesocket import *
try:
form=cgi.FieldStorage()
if form.has_key("server"):
server=form["server"].value
else:
server="localhost"
if form.has_key("p... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import sys,cgi,re,Image,Gnuplot,string,os
sys.path+=[os.getcwd()]
from types import *
from firesocket import *
try:
form=cgi.FieldStorage()
if form.has_key("server"):
server=form["server"].value
else:
server="localhost"
if form.has_key("p... | Python |
#!/usr/bin/python
import sys
import cgi
import re
import Image
sys.stderr=sys.stdout
try:
form=cgi.FieldStorage()
imagefilename=form["image"].value
outWidth=-1
outHeight=-1
maxDim=-1
if(form.has_key("max")):
maxDim=int(form["max"].value)
if(form.has_key("width")):
outWidth... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#$Header$
# print cgi-header
print "Content-Type: text/html\n\n"
print
#print "<pre style=\"font-family:Fixedsys,Courier,1px;\">" # to have error messages as readable as possible, this
# is switched of right before displaying the main part of the page
... | Python |
#default settings
positiveImg="images/positive.png"
negativeImg="images/negativ.png"
neutralImg="images/neutral.png"
fireLogo="images/fire-logo.png"
i6Logo="images/i6.png"
TemplateFile = "fire-template.html"
fireServer="localhost"
firePort=12960
imgpyurl="img.py"
fireurl="fire.py"
#tempdir="/tmp"
#maxSize=1000, 1000
#m... | Python |
#!/usr/bin/python
import sys
import cgi
import re
import Image
sys.stderr=sys.stdout
try:
form=cgi.FieldStorage()
imagefilename=form["image"].value
outWidth=-1
outHeight=-1
maxDim=-1
if(form.has_key("max")):
maxDim=int(form["max"].value)
if(form.has_key("width")):
outWidth... | Python |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#$Header$
# print cgi-header
print "Content-Type: text/html\n\n"
print
#print "<pre style=\"font-family:Fixedsys,Courier,1px;\">" # to have error messages as readable as possible, this
# is switched of right before displaying the main part of the page
... | Python |
#!/usr/bin/python
import sys,re
import filelist
filelist=filelist.FileList()
filelist.load(sys.argv[1])
for i in filelist:
cls=i[1]
fname=i[0]
print fname,
for j in filelist:
if j[1]==cls and j[0]!=fname:
print j[0],
print
#print filelist
| Python |
import re,sys,string,os
class FileList:
def __init__(self):
self.files=[]
self.classes=False
self.featuredirectories=False
self.descriptions=False
self.path=""
self.rawpath=""
self.suffices=[]
self.filename2idx={}
def __str__(self):
result... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
#-----------------------------------------------------------------
s=firesocket.FIRESocket()
try:
if len(sys.argv) < 5:
print """USAGE:
makedistfiles.py <query... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
filelist=filelist.FileList()
filelist.load(sys.argv[1])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exit(10)
for i in filelist:
cls=i[1]
desc=[]
#pr... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class SparseHistogramFeature:
def __init__(self):
self.bins={}
self.data={}
self.steps=[]
self.stepSize=[]
self.min=[]
self.max=[]
self.dim=0
self.numberofBins=0
self.counter... | Python |
#------------------------------------------------------------------------------
# proxyserver implementation for communication with the web frontend and fire
# server system
# server must be reachable via network sockets in order to be of any use
#
#--------------------------------------------------------------------... | Python |
#!/usr/bin/python
from string import split, lower, strip
from random import shuffle
import sys
import os
from os.path import join, getsize
ARCH=os.environ["ARCH"]
# returns the string after a certain option string
def getStringAfter(name, array, default):
for i in range(len(array)):
if array[i] == name:
... | Python |
#!/usr/bin/python
from string import split, lower, strip
from random import shuffle
import sys
import os
from os.path import join, getsize
ARCH=os.environ["ARCH"]
# returns the string after a certain option string
def getStringAfter(name, array, default):
for i in range(len(array)):
if array[i] == name:
... | Python |
#!/usr/bin/env python
import sys,gzip
class Feature:
def __init__(self):
self.posx=0
self.posy=0
self.scale=0
self.vec=[]
class LocalFeatures:
def __init__(self):
self.winsize=0
self.dim=0
self.subsampling=0
self.padding=0
self.numberOfF... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class HistogramFeature:
def __init__(self):
self.steps=[]
self.bins=[]
self.min=[]
self.max=[]
self.stepsize=[]
self.dim=0
self.counter=0
self.filename=""
self.data=[]
d... | Python |
#!/usr/bin/python
import sys
#this script merges fire distance files.
#
# as command line parameters, arbitrary many distance files are given and
# the merged distance file is printed.
infiles=[]
line=[]
for i in sys.argv[1:]:
infiles.append(open(i,"r"))
line.append("")
line[0]=infiles[0].readline()
count=... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
querylist=filelist.FileList()
filelist=filelist.FileList()
filelist.load(sys.argv[1])
querylist.load(sys.argv[2])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exi... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback,numarray
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
server="localhost"
port=12960
database=""
qu... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
useX="-x" in sys.argv
ve... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
filelist=filelist.FileList()
filelist.load(sys.argv[1])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exit(10)
for i in filelist:
cls=i[1]
desc=[]
#pr... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class SparseHistogramFeature:
def __init__(self):
self.bins={}
self.data={}
self.steps=[]
self.stepSize=[]
self.min=[]
self.max=[]
self.dim=0
self.numberofBins=0
self.counter... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
#-----------------------------------------------------------------
s=firesocket.FIRESocket()
try:
if len(sys.argv) < 5:
print """USAGE:
makedistfiles.py <query... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
try:
time.sleep(1) #... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback
#sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
... | Python |
#!/usr/bin/python
import sys,re
import filelist
filelist=filelist.FileList()
filelist.load(sys.argv[1])
for i in filelist:
cls=i[1]
fname=i[0]
print fname,
for j in filelist:
if j[1]==cls and j[0]!=fname:
print j[0],
print
#print filelist
| Python |
#!/usr/bin/python
import sys,re,filelist
if len(sys.argv)<3:
print """USAGE filelistquery2querylist.py <querylist> <dblist>"""
sys.exit(5)
qlist=filelist.FileList()
qlist.load(sys.argv[1])
dblist=filelist.FileList()
dblist.load(sys.argv[2])
for i in qlist:
cls=i[1]
fname=i[0]
print fname,
f... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
useX="-x" in sys.argv
ve... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time
class mysocket:
'''Socket stolen somewhere from the net'''
def __init__(self, sock=None):
if sock is None:
self.sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
... | Python |
#!/usr/bin/python
import sys,re,filelist
if len(sys.argv)<3:
print """USAGE filelistquery2querylist.py <querylist> <dblist>"""
sys.exit(5)
qlist=filelist.FileList()
qlist.load(sys.argv[1])
dblist=filelist.FileList()
dblist.load(sys.argv[2])
for i in qlist:
cls=i[1]
fname=i[0]
print fname,
f... | Python |
import socket, os, sys,re
# ----------------------------------------------------------------------
# socket implementation for comunication with the server system
# running on any computer which is reachable via network sockets
# here we need mainly the functions
# * connect
# * sendcmd
# * getline
# * close
# for the... | Python |
#!/usr/bin/python
import sys,re
import filelist,porterstemmer
querylist=filelist.FileList()
filelist=filelist.FileList()
filelist.load(sys.argv[1])
querylist.load(sys.argv[2])
stemmer=porterstemmer.PorterStemmer()
if not filelist.descriptions:
print "no descriptions, this program is not appropriate"
sys.exi... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback
#sys.path.append("/u/deselaers/work/src/fire/python")
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
... | Python |
#!/usr/bin/env python
import gzip
# class for FIRE histogramfeatures
class HistogramFeature:
def __init__(self):
self.steps=[]
self.bins=[]
self.min=[]
self.max=[]
self.stepsize=[]
self.dim=0
self.counter=0
self.filename=""
self.data=[]
d... | Python |
#!/usr/bin/python
import sys, socket, re, os, string, time, traceback
#sys.path.append("../python")
import firesocket
def retrieveData(param):
data = {}
s=firesocket.FIRESocket()
try:
ql=open(sys.argv[1],"r")
host=sys.argv[2]
port=int(sys.argv[3])
try:
time.sleep(1) #... | Python |
#!/usr/bin/python
# easy script for automatic batches with fire
# takes database files for queries
# calculates error rate only
import sys, socket, re, os, string, time, traceback,numarray
import firesocket,filelist
# forget own name in commandline options
sys.argv.pop(0)
server="localhost"
port=12960
database=""
qu... | Python |
#!/usr/bin/env python
import sys,gzip
class Feature:
def __init__(self):
self.posx=0
self.posy=0
self.scale=0
self.vec=[]
class LocalFeatures:
def __init__(self):
self.winsize=0
self.dim=0
self.subsampling=0
self.padding=0
self.numberOfF... | Python |
#!/usr/bin/python
import sys
#this script merges fire distance files.
#
# as command line parameters, arbitrary many distance files are given and
# the merged distance file is printed.
infiles=[]
line=[]
for i in sys.argv[1:]:
infiles.append(open(i,"r"))
line.append("")
line[0]=infiles[0].readline()
count=... | Python |
#
# jython examples for jas.
from jas import Module
from jas import SubModule
# module example
r = Module( "Rat(u,v,l) L", cols=4 );
print "Module: " + str(r);
print;
G = r.gens();
print "gens() = ", [str(e) for e in G];
L = [ e.elem.val for e in G ]
print "gens() = ", [str(e) for e in L];
M = r.submodul( list=L ... | Python |
#
# jython examples for jas.
# $Id$
#
from java.lang import System
from java.lang import Integer
from jas import Ring, PolyRing
from jas import terminate
from jas import startLog
from jas import QQ, DD
# polynomial examples: ideal primary decomposition
#r = Ring( "Rat(x) L" );
#r = Ring( "Q(x) L" );
r = PolyRing(Q... | Python |
#
# jython examples for jas.
# $Id$
#
import sys;
from jas import Ring, PolyRing, Ideal, QQ, ZZ, GF, ZM, CC
from jas import startLog, terminate
# trinks 6/7 example
# QQ = rational numbers, ZZ = integers, CC = complex rational numbers, GF = finite field
#QQ = QQ(); ZZ = ZZ(); CC = CC();
#r = PolyRing( GF(19),"B,S,T... | Python |
#
# jython examples for jas.
# $Id$
#
import sys;
from jas import PolyRing, QQ, RF
from jas import Ideal
from jas import startLog
from jas import terminate
# Montes JSC 2002, 33, 183-208, example 11.1
# integral function coefficients
r = PolyRing( PolyRing(QQ(),"c, b, a",PolyRing.lex), "z,y,x", PolyRing.lex );
pri... | Python |
#
# jython examples for jas.
# $Id$
#
from java.lang import System
from java.lang import Integer
from jas import SolvableRing, SolvPolyRing, PolyRing
from jas import QQ, startLog, SRC, SRF
# Ore extension solvable polynomial example, Gomez-Torrecillas, 2003
pcz = PolyRing(QQ(),"x,y,z");
#is automatic: [one,x,y,z] =... | Python |
# jython examples for jas.
# $Id$
#
import sys
from ja... | Python |
#
# jython examples for jas.
# $Id$
#
from java.lang import System
from java.lang import Integer
from jas import Ring, PolyRing
from jas import terminate
from jas import startLog
from jas import QQ, DD
# polynomial examples: real roots over Q
#r = Ring( "Rat(x) L" );
#r = Ring( "Q(x) L" );
r = PolyRing(QQ(),"x",Po... | Python |
#
# jython examples for jas.
# $Id$
#
import sys;
from jas import Ring
from jas import Ideal
from jas import startLog
from jas import terminate
# ? example
#r = Ring( "Rat(t,x,y,z) L" );
#r = Ring( "Z(t,x,y,z) L" );
#r = Ring( "Mod 11(t,x,y,z) L" );
r = Ring( "Rat(t,x,y) L" );
print "Ring: " + str(r);
print;
ps ... | 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.