code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | Python |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | Python |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | Python |
#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2
#
# FleetPanel.py, part of the FleetPanel
#
# Copyright (c) 2009 Dariusz Mikulski email: dariusz.mikulski@gmail.com
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have rece... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2
#
# FleetPanel.py, part of the FleetPanel
#
# Copyright (c) 2009 Dariusz Mikulski email: dariusz.mikulski@gmail.com
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have rece... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:
import time
from datetime import datetime
class Signature:
def __init__(self, solar, signature, planet, typee, name, comment, creator, creation_time ):
self.solar = solar
self.signature = signature
self.planet = planet
self.typee... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:
import time
from datetime import datetime
class Signature:
def __init__(self, solar, signature, planet, typee, name, comment, creator, creation_time ):
self.solar = solar
self.signature = signature
self.planet = planet
self.typee... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2
#
# FleetPanel.py, part of the FleetPanel
#
# Copyright (c) 2009 Dariusz Mikulski email: dariusz.mikulski@gmail.com
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have rece... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2
#
# FleetPanel.py, part of the FleetPanel
#
# Copyright (c) 2009 Dariusz Mikulski email: dariusz.mikulski@gmail.com
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have rece... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:
import time
from datetime import datetime
class Signature:
def __init__(self, solar, signature, planet, typee, name, comment, creator, creation_time ):
self.solar = solar
self.signature = signature
self.planet = planet
self.typee... | Python |
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:
import time
from datetime import datetime
class Signature:
def __init__(self, solar, signature, planet, typee, name, comment, creator, creation_time ):
self.solar = solar
self.signature = signature
self.planet = planet
self.typee... | Python |
__import__('pkg_resources').declare_namespace(__name__)
| Python |
# -*- coding: utf-8 -*-
'''
flaskext.yamlconfig
~~~~~~~~~~~~~~~~~~~
YAML configurator for Flask app.
'''
from __future__ import with_statement
import yaml
from flask import request
from flask import current_app
from flask import render_template
from werkzeug import import_st... | Python |
"""
Flask-YAMLConfig
----------------
Usage
-----
::
from flaskext.yamlconfig import AppYAMLConfig
AppYAMLConfig(app, "main.yaml")
or
::
from flaskext.yamlconfig import install_yaml_config
from flaskext.yamlconfig import AppYAMLConfig
class MyConfig(AppYAMLConfig):
def conf... | Python |
bola = 'bola.gif'
campo = 'campo.jpg'
import pygame, sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((620,390),0,0)
background=pygame.image.load(campo).convert()
mouse_c=pygame.image.load(bola).convert_alpha()
j = "teste"
while True:
for event in pygame.event.get():
if event... | Python |
#-*- coding: utf-8 -*-
import random
from classifier import classifier
class genetyk():
def __init__(self,grammar,properites):
self.grammar = grammar
self.properties = properites
def ruletSelection(self):
suma = 0.0
for x in self.grammar.G:
f... | Python |
#-*- coding: utf-8 -*-
import string, random
from properties import properties
from classifier import classifier
from genetyk import genetyk
from membership_Funkctions import membershipOperations
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
... | Python |
class genetyk():
pass | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
def __init__(self):
#Gramatyka w postaci slownika
self.G = {"S":["AB","BC"],"A":["BA","a"]... | Python |
#-*- coding: utf-8 -*-
#klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
class gr... | Python |
import string, random
positions = [22.23423, 8.345345]
def updatePosition(positions):
positions[0]=positions[0]+random.uniform(-0.0123,0.0232)
positions[1]=positions[0]+random.uniform(-0.0123,0.0232)
tmp = "/web/main/updateLocation.html?longitude="+str(positions[0])+"&latitude="+str(positions[1])... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
#Gramat... | Python |
import sys, string
from CYK import gramatyka
from properties import properties
from PyQt4 import QtCore, QtGui
from okno_new import Ui_GCS
class MyForm(QtGui.QMainWindow):
#definicja zmiennych :
testingWords = []
fileIndex = 0
word = "aabb"
G = gramatyka()
parametry = properties()
... | Python |
#-*- coding: utf-8 -*-
#klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
class ... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
#Gramatyka w... | Python |
from distutils.core import setup
import py2exe
setup(console=['GUI.py'])
| Python |
class properties():
def __init__(self):
self.Pk=0.5
self.Pm=0.5
self.Pi=0.5
#pelne pokrycie:
self.Pa=0.78
self.cf=5
self.cs=5
self.ba=5
self.raf=5
self.ts=0
#rozmiar populacji:
self.np=10
self.n... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'okno_new.ui'
#
# Created: Mon Sep 01 12:18:38 2008
# by: PyQt4 UI code generator 4.4.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_GCS(object):
def setupUi(self, GC... | Python |
import sys, string
from PyQt4 import QtCore, QtGui
from CYK import gramatyka
from okno import Ui_CYK
class MyForm(QtGui.QMainWindow):
#definicja zmiennych :
word = "aaaaabbbbsss"
G = gramatyka()
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
sel... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
class gramatyka():
'''klas... | Python |
class classifier():
'''klasa bedzie representowac klasyfikator w systemie'''
def __init__(self,name, left):
#prawa strona kalsyfikatora
self.left = left;
self.right = name
'''ilosc uzyc jest realizowana za pomoca tablicy
u[0] -> ilosc uzyc klasyfikatora przy parsowaniu z... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'properties_window.ui'
#
# Created: Tue Aug 26 11:08:30 2008
# by: PyQt4 UI code generator 4.4.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Properties(object):
def ... | Python |
#-*- coding: utf-8 -*-
#klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
class ... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
#Gramat... | Python |
#-*- coding: utf-8 -*
import random
class membershipOperations():
''' klassa na podstawie gramatyki i aktualnego stanu srodowiska obliczac bedzie funkcje przynaleznosci dla danego klasyfikatora w danym momenci rozbiou zdania'''
def __init__(self, parent):
self.parent = parent
self.functionType... | Python |
#-*- coding: utf-8 -*-
#klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
from g... | Python |
#-*- coding: utf-8 -*-
import datetime
import sys, os
from properties import properties
########################################################################
class testReporter:
"""Klasa ma za zadanie raportowanie wyników testow"""
#----------------------------------------------------------------------
... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'popup.ui'
#
# Created: Mon Sep 7 11:37:15 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
#Gramatyka w... | Python |
#-*- coding: utf-8 -*-
import sys
import string
import re
from PyQt4 import QtCore, QtGui
from task_GUI import Ui_Tasks
from thread_flcs import funnction_FLSC
class tasks_generator(QtGui.QMainWindow):
def __init__(self, parent):
QtGui.QWidget.__init__(self, parent)
self.regular_expresion = '... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'task_generate.ui'
#
# Created: Mon Jul 20 22:22:57 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Tasks(object):
def setupUi(self, Anuluj)... | Python |
#-*- coding: utf-8 -*-
class properties():
def __init__(self):
#krzyzowanie
self.Pk=0.2
#mutacja
self.Pm=0.8
#inwersja
self.Pi=0.0
#pelne pokrycie:
self.Pa=0.0
self.cf=18
self.cs=3
self.ba=1
self.raf=0.5
... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'okno_new.ui'
#
# Created: Tue Sep 8 23:53:05 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_GCS(object):
def setupUi(self, GCS):
... | Python |
#-*- coding: utf-8 -*-
import sys, string, random
from CYK_new import gramatyka
from properties import properties
from PyQt4 import QtCore, QtGui
from okno_new import Ui_GCS
from gen_learning import tasks_generator
from genetyk import genetyk
from thread_flcs import funnction_FLSC
from popUps import popUp
... | Python |
import sys, string
from PyQt4 import QtCore, QtGui
from CYK import gramatyka
from okno import Ui_CYK
class MyForm(QtGui.QMainWindow):
#definicja zmiennych :
word = "aaaaabbbbsss"
G = gramatyka()
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
sel... | Python |
#-*- coding: utf-8 -*-
from PyQt4 import QtCore
from flcs import gramatyka
from testReporter import testReporter
from membership_Funkctions import membershipFunctions
import time
import sys
class funnction_FLSC(QtCore.QThread):
def __init__(self, parent):
super(funnction_FLSC, self).__init__(parent)
se... | Python |
#-*- coding: utf-8 -*-
from popupWindow import Ui_Dialog
from PyQt4 import QtCore, QtGui
class popUp(QtGui.QMainWindow):
def __init__(self,parent):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_Dialog()
self.ui.setupUi(self)
QtCore.QObject.connect(self.ui.buttonOK, QtCore.SIGN... | Python |
#-*- coding: utf-8 -*-
class classifier():
'''klasa bedzie representowac klasyfikator w systemie'''
def __init__(self,name, left):
#prawa strona kalsyfikatora
self.left = left;
self.right = name
'''ilosc uzyc jest realizowana za pomoca tablicy
u[0] -> ilosc uzyc klasyfi... | Python |
#-*- coding: utf-8 -*-
import random
from classifier import classifier
class genetyk():
def __init__(self,grammar,properites):
self.grammar = grammar
self.properties = properites
def ruletSelection(self):
suma = 0.0
for x in self.grammar.G:
f... | Python |
#-*- coding: utf-8 -*-
#klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
class ... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
#Gramat... | Python |
#-*- coding: utf-8 -*-
#klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
import string, random
from properties import properties
from classifier import classifier
from g... | Python |
##klasa ta reperezentowac bedzie gramatyke
# trzeba zamontowac tutaj funkcje umozliwiajace edycje gramtyki
# narazie bedzie to jedynie statyczna klasa posiadajaca jedna gramtyke na sztywno
class gramatyka():
'''klasa zaiwera gramatyke wraz z operacja,i na niej dostepnymi'''
def __init__(self):
#Gramatyka w... | Python |
#-*- coding: utf-8 -*-
import sys
import string
from PyQt4 import QtCore, QtGui
from task_GUI import Ui_Tasks
class tasks_generator(QtGui.QMainWindow):
def __init__(self, parent):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_Tasks()
self.ui.setupUi(self)
#wzór do generowa... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'task_generate.ui'
#
# Created: Mon Jul 20 22:22:57 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Tasks(object):
def setupUi(self, Anuluj)... | Python |
#-*- coding: utf-8 -*-
class properties():
def __init__(self):
#krzyzowanie
self.Pk=0.2
#mutacja
self.Pm=0.8
#inwersja
self.Pi=0.0
#pelne pokrycie:
self.Pa=0.0
self.cf=18
self.cs=3
self.ba=1
self.raf=0.5
... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'okno_new.ui'
#
# Created: Sun Jul 19 23:20:59 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_GCS(object):
def setupUi(self, GCS):
... | Python |
#-*- coding: utf-8 -*-
import sys, string, random
from CYK_new import gramatyka
from properties import properties
from PyQt4 import QtCore, QtGui
from okno_new import Ui_GCS
from gen_learning import tasks_generator
from genetyk import genetyk
class MyForm(QtGui.QMainWindow):
#definicja zmiennych :
... | Python |
import sys, string
from PyQt4 import QtCore, QtGui
from CYK import gramatyka
from okno import Ui_CYK
class MyForm(QtGui.QMainWindow):
#definicja zmiennych :
word = "aaaaabbbbsss"
G = gramatyka()
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
sel... | Python |
#-*- coding: utf-8 -*-
class classifier():
'''klasa bedzie representowac klasyfikator w systemie'''
def __init__(self,name, left):
#prawa strona kalsyfikatora
self.left = left;
self.right = name
'''ilosc uzyc jest realizowana za pomoca tablicy
u[0] -> ilosc uzyc klasyfi... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'popup.ui'
#
# Created: Mon Sep 7 11:37:15 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'task_generate.ui'
#
# Created: Mon Jul 20 22:22:57 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Anuluj(object):
def setupUi(self, Anuluj... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'okno_new.ui'
#
# Created: Tue Sep 8 23:53:05 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_GCS(object):
def setupUi(self, GCS):
... | Python |
from google.appengine.ext import db
from datetime import datetime
class Flea_Server(db.Model):
owner = db.UserProperty( required = True )
server_name = db.StringProperty()
ip_address = db.StringProperty()
last_active_time = db.DateTimeProperty()
uuid = db.StringProperty( required = True )
... | Python |
from google.appengine.ext import webapp
from google.appengine.api import users
class BaseAction(webapp.RequestHandler):
dict_data = None
def __init__(self):
self.dict_data = {
"user_status" : user_wrapper(),
}
def viewdata(self, key, value):
self.di... | Python |
from google.appengine.ext import webapp
from actions import *
from google.appengine.ext.webapp import template
application = webapp.WSGIApplication([
('/', Home),
('/Export', Export),
('/Add',Add),
('/Link',Link),
('/PublicServer',PublicServer),
('/Delete',Delete),
], debug=True)
def main()... | Python |
import urllib
import time
def send_request( url, server_name ):
url_address = "http://" + url
counter = 1
print url_address
while 1:
urllib.urlopen( url_address,None )
time.sleep( 60 )
counter += 1
if __name__ == '__main__':
host = 'localhost:9999'
path = '/... | Python |
import cgi
import datetime
import wsgiref.handlers
from google.appengine.api import users
from google.appengine.ext import webapp
from models import *
import os
from google.appengine.ext.webapp import template
import uuid
from base_action import BaseAction
def getTemplatePath(template_name):
path... | Python |
class UserStatus(object):
pass | Python |
#from actions import *
import unittest
class test_add_server(unittest.TestCase):
def test_action_should_handle_the_parameters_from_request(self):
#addServerAction = AddServer()
#assert addServerAction != None, "AddServer class is not existed"
mockClient = self.client
if __... | Python |
from google.appengine.ext import webapp
from datetime import datetime
register = webapp.template.create_template_register()
@register.filter
def relative_time(value):
if value is None:
return "N/A"
passed_time = datetime.now() - value
if passed_time.days > 0:
return str( passed_ti... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
from ctms import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5840, debug=True)
| Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
import os
DEBUG = False
CSRF_ENABLED = False
SECRET_KEY = 'jmN]X R8/X0XHZyj~,?!93LWRT/ArH'
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
APP_FOLDER = 'ctms'
CTMS_DATABASE = 'ctms.db3'
DATABASE = os.path.join(BASE_PATH, APP_FOLDER, CTMS_DATABASE)
SQLAL... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
from ctms import sa
class User(sa.Model):
__tablename__ = 't_user'
u_id = sa.Column(sa.Integer, primary_key=True)
u_user = sa.Column(sa.String(64), unique=True, nullable=False)
u_name = sa.Column(sa.String(32), nullable=False)
u_pass = sa.C... | Python |
# -*- coding: utf-8 -*-
import StringIO
__author__ = 'ggcall'
import requests
import sqlite3
import re
import os
from PIL import Image
def randcode(pic):
# pic_name="old.jpg"
# f = open(pic_name, 'wb')
# f.write(pic)
# f.close
# time.sleep(5)
# box=(0,0,60,20)
im=StringI... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
import sqlite3
import re
from datetime import datetime
from ctms import app, sa
from contextlib import closing
from flask import request, render_template, jsonify, redirect, url_for, Response, send_file, g, session
from config import DATABASE
from models impor... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.mail import Mail
from config import BASE_PATH, MAIL_PASSWORD, MAIL_PORT, MAIL_SERVER, MAIL_USERNAME, ADMINS
app = Flask(__name__... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
from gis import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5002, debug=True)
| Python |
# -*- coding: utf-8 -*-
import cx_Oracle
con = cx_Oracle.connect('gis/ndtvgis@192.168.20.79/GIS')
# print con.version
cur = con.cursor()
odf表 teodf
光交接表 tegjjx
光终端盒表 tegzdh
光分路器表 teobd
olt表 teolt
odf模块表 teodm
光设备模块表 tegldzb
光设备端子表 tegjsbdz
光设备跳纤表 teg... | Python |
# -*- coding: utf-8 -*-
import cx_Oracle
con = cx_Oracle.connect('gis/ndtvgis@192.168.20.79/GIS')
print con.version
cursor = con.cursor()
cursor.execute("select * from tegjd where bm=:bm",{'bm':'HS.ZFY/SQY/GJD01'})
rows=cursor.fetchall()
for row in rows:
print row
cursor.execute("select * from teg... | Python |
# -*- coding: utf-8 -*-
from sqlalchemy import *
from sqlalchemy.sql import select
from sqlalchemy.schema import *
# create the engine for oracle db
# we need to install cx_Oracle and sqlalchemy in advance.
db_engine=create_engine('oracle://gis:ndtvgis@192.168.20.79:1521/GIS', echo=True)
# test the ddl to db ... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
import os
DEBUG = False
CSRF_ENABLED = False
SECRET_KEY = 'jmN]X R8/X0XHZyj~,?!93LWRT/ArH'
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
APP_FOLDER = 'gis'
DATABASE = 'gis/ndtvgis@192.168.20.79/GIS'
print DATABASE
# email server
MAIL_SERVER = 'yo... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
| Python |
# -*- coding: utf-8 -*-
import StringIO
__author__ = 'ggcall'
import requests
import sqlite3
import re
import os
from PIL import Image
def randcode(pic):
# pic_name="old.jpg"
# f = open(pic_name, 'wb')
# f.write(pic)
# f.close
# time.sleep(5)
# box=(0,0,60,20)
im=StringI... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
import sqlite3
import re
import json
import time
from datetime import datetime
from gis import app
from contextlib import closing
from flask import request, render_template, jsonify, redirect, url_for, Response, send_file, g, session, make_response
from config... | Python |
# -*- coding: utf-8 -*-
__author__ = 'gongqf'
import cx_Oracle
from flask import Flask, g
from config import DATABASE
# import os
# os.environ["NLS_LANG"] = "SIMPLIFIED CHINESE.ZHS16GBK"
app = Flask(__name__)
app.config.from_object('config')
def CloseDB():
if hasattr(g, 'db'):
g.db.close()
... | Python |
# -*- coding: utf-8 -*-
import cx_Oracle
con = cx_Oracle.connect('gis/ndtvgis@192.168.20.79/GIS')
# print con.version
cursor = con.cursor()
cursor.execute("select sum(gdcd) from tegdd t")
for result in cursor:
print u'统计管道段长度:',result[0]
cursor.execute("select count(*) from tersj")
for res... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This script will try to create the minig indexes for all the users
# with active mail_perms in the OBM database.
#
# Depends: python-psycopg2 for postgresql or python-mysqldb for mysql.
import ConfigParser;
import os;
import sys;
import httplib;
import urllib;
# Read /et... | Python |
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as etree
import sys
tree = None
root = None
def loadFile(url):
global tree
tree = etree.parse(url)
global root
root = tree.getroot()
for e in root:
if e.tag.lower() == "modules":
root = e
break
def printXML... | Python |
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as etree
import sys
tree = None
root = None
def loadFile(url):
global tree
tree = etree.parse(url)
global root
root = tree.getroot()
for e in root:
if e.tag.lower() == "modules":
root = e
break
def printXML... | Python |
#====================================================================
# 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 ... | Python |
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from blog.views import FlexView
import os
class MainPage(webapp.RequestHandler):
def get(self):
self.redirect('/blog')
c... | Python |
"""
Model classes for the flex-pyamf-blog
"""
from google.appengine.ext.db import Model
from google.appengine.ext import db
class MiniPost(Model):
body = db.TextProperty()
category = db.CategoryProperty()
date = db.DateTimeProperty(auto_now_add=True)
title = db.StringProperty()
class StaticPage(Model)... | Python |
#!/usr/bin/env python
#
import os
import urllib
from google.appengine.ext import blobstore
from google.appengine.ext import webapp
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
class MainHandler(we... | Python |
#!/usr/bin/env python
#
import os
import urllib
from google.appengine.ext import blobstore
from google.appengine.ext import webapp
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
class MainHandler(we... | 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.