code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env python
# Parse output trace file from a binary compiled with -finstrument-functions flag
# Replaces function addresses with name and location of functions
# ...using addr2line utility from binutils
import sys
import getopt
import re
import os.path
from os import popen
def usage() :
print "Usage: p... | Python |
#-----------------------------------------------------------------------------
# ply: lex.py
#
# Author: David M. Beazley (dave@dabeaz.com)
#
# Copyright (C) 2001-2007, David M. Beazley
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Licen... | Python |
# PLY package
# Author: David Beazley (dave@dabeaz.com)
__all__ = ['lex','yacc']
| Python |
#-----------------------------------------------------------------------------
# ply: yacc.py
#
# Author(s): David M. Beazley (dave@dabeaz.com)
#
# Copyright (C) 2001-2007, David M. Beazley
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# L... | Python |
#coding=utf8
#$Id: shell.py 206 2008-06-05 13:17:28Z Filia.Tao@gmail.com $
'''
解释器Shell
可以加载两个不同的引擎,来解释不同的语言
'''
import sys
sys.path.insert(0,"..")
class Shell:
def __init__(self,name,engineer):
self.code = ""
self.engineer = engineer
self.name = name
self.recent_c... | Python |
#coding=utf8
#$Id: error.py 119 2008-04-27 06:07:41Z Filia.Tao@gmail.com $
'''
错误类型和错误报告系统
'''
class Error(Exception):
error_type = "error" #can be error, warning , notice
def __init__(self, lineno, msg):
self.lineno = lineno
self.msg = msg
def __str__(self):
return ... | Python |
#coding=utf8
#$Id: function.py 185 2008-05-23 11:58:16Z Filia.Tao@gmail.com $
import copy
import sys
import interpretor.smallc.lang as lang
import interpretor.smallc.error as error
def copy_ns(ns_dict):
ret = copy.copy(ns_dict)
for x in ret:
ret[x] = copy.copy(ns_dict[x])
return ret
... | Python |
#coding=utf8
#$Id: lex.py 206 2008-06-05 13:17:28Z Filia.Tao@gmail.com $
#Copyright 2007 Tao Fei (filia.tao@gmail.com)
#Released under GPL V3 (or later)
#see http://www.gnu.org/copyleft/gpl.html for more details
import ply.lex as lex
tokens = ('id', 'num',
'orop','andop','eqop', 'neop', 'ltop',... | Python |
#coding=utf8
#$Id: interp.py 203 2008-06-04 11:55:03Z Filia.Tao@gmail.com $
'''
SmallC 语言解释器
工作在抽象语法树上。
SmallC 不允许函数嵌套。
'''
import operator
import sys
import interpretor.smallc.lang as lang
import interpretor.smallc.error as error
from interpretor.smallc.function import Function,get_built_in_ns,copy_ns,set... | Python |
#coding=utf8
#$Id: __init__.py 201 2008-06-03 03:03:11Z Filia.Tao@gmail.com $
lang_info = {
'name' : 'L1',
'path' : 'smallc',
'suffix' : 'smc',
}
| Python |
#coding=utf8
#$Id: sementic.py 92 2008-04-22 13:28:20Z Filia.Tao@gmail.com $
#DONT'T READ OR USE THIS FILE
'''定义SmallC 的语义
1. 静态语义
首先是最简单的操作的类型匹配
'''
import interpretor.smallc.lang
#类型约束
#这个应该作为语言定义的一部分
#一条约束规则应该包含如下的内容
# * 操作符
# * 约束规则列表
#用一个简单的列表就可以
type_requirements = {}
#这里在全局字典 type_requirem... | Python |
#coding=utf8
#$Id: parse.py 206 2008-06-05 13:17:28Z Filia.Tao@gmail.com $
from ply import yacc
from interpretor.smallc.lex import *
from interpretor.ast import Node,all_to_node,to_graph
from interpretor.smallc import error
start = 'prog'
def p_empty(p):
"empty : "
pass
#程序
def p_prog(p):
... | Python |
#coding=utf8
#$Id: lang.py 119 2008-04-27 06:07:41Z Filia.Tao@gmail.com $
'''
Small C 语言只有三种类型。
1. 整形
2. Void
3. 数组
4. 结构体 (数组)
注意这个里面变量名是类似java 的引用机制。
怎样处理特殊的null 值? (用Object(nullType,"Null Value") 来表示。
从程序中可以看到 null 似乎可以赋值给任何类型的对象。(除了整数对象)
从给的示例代码来看,似乎 整形默认值为0 ,其他默认值为null
一个结构体,member 也按这个规则初始化。
我... | Python |
#coding=utf8
#$Id: error.py 206 2008-06-05 13:17:28Z Filia.Tao@gmail.com $
class Error(Exception):
error_type = "error" #can be error, warning , notice
def __init__(self, lineno, msg):
self.lineno = lineno
self.msg = msg
def __str__(self):
return "line %s: %s: %s" %(s... | Python |
#coding=utf8
#$Id: function.py 204 2008-06-04 12:56:45Z Filia.Tao@gmail.com $
import copy,sys
from interpretor.ooc import lang
from interpretor.ooc import error
def report_none(func):
def w(self, t):
r = func(self, t)
if r is None:
print "get %s from %s got None" , t, self.... | Python |
#coding=utf8
#$Id: lex.py 189 2008-05-27 14:57:58Z Filia.Tao@gmail.com $
#Copyright 2007 Tao Fei (filia.tao@gmail.com)
#Released under GPL V3 (or later)
#see http://www.gnu.org/copyleft/gpl.html for more details
import ply.lex as lex
tokens = ('id', 'num',
'orop','andop','eqop', 'neop', 'ltop',... | Python |
#coding=utf8
#$Id: interp.py 206 2008-06-05 13:17:28Z Filia.Tao@gmail.com $
'''
ooc 语言解释器
工作在抽象语法树上。
'''
import operator
import copy
import sys
import ply
import interpretor.ooc.lang as lang
from interpretor.ooc.parse import parse
from interpretor.ooc.function import Function,AbstractFunction,get_built_in... | Python |
#coding=utf8
#$Id: __init__.py 201 2008-06-03 03:03:11Z Filia.Tao@gmail.com $
lang_info = {
'name' : 'L2',
'path' : 'ooc',
'suffix' : 'ooc',
}
| Python |
#coding=utf8
#$Id: parse.py 206 2008-06-05 13:17:28Z Filia.Tao@gmail.com $
import sys
from ply import yacc
from interpretor.ooc.lex import *
from interpretor.ast import Node,all_to_node,to_graph
from interpretor.ooc import error
start = 'prog'
def p_empty(p):
"empty : "
pass
#程序
def p_prog(p... | Python |
#coding=utf8
#$Id: lang.py 204 2008-06-04 12:56:45Z Filia.Tao@gmail.com $
'''
OOC C 语言只有三种类型。
1. 整形
2. Void
3. 数组
4. 类
注意这个里面变量名是类似java 的引用机制。
null 表示空引用。
怎样处理特殊的null 值? (用Object(nullType,None) 来表示。
从程序中可以看到 null 似乎可以赋值给任何类型的对象。
'''
from interpretor.ooc import error
#class Singleton(type):
# ... | Python |
#coding=utf8
#$Id: error.py 84 2008-04-20 07:07:11Z Filia.Tao@gmail.com $
class ParseError(Exception):
def __init__(self,token):
self.token = token
def __str__(self):
return "Parser error at line %d token '%s'" %(self.token.lineno, self.token.value)
class LangError(Exception):
... | Python |
#coding=utf8
#$Id: function.py 205 2008-06-05 04:46:30Z Filia.Tao@gmail.com $
'''Kernel C 函数
'''
import sys
from interpretor.kernelc import lang
from interpretor.kernelc import error
class Namespace(dict):
def __getitem__(self, key):
if not self.has_key(key):
if type(key) is int:
... | Python |
#coding=utf8
#$Id: lex.py 205 2008-06-05 04:46:30Z Filia.Tao@gmail.com $
#Copyright 2007 Tao Fei (filia.tao@gmail.com)
#Released under GPL V3 (or later)
#see http://www.gnu.org/copyleft/gpl.html for more details
import ply.lex as lex
tokens = ('id', 'num',
'orop','andop','eqop', 'neop', 'ltop',... | Python |
#coding=utf8
#$Id: interp.py 205 2008-06-05 04:46:30Z Filia.Tao@gmail.com $
'''
KernelC 语言解释器
工作在抽象语法树上。
由于KernelC 语言极端简单。没有作用域等等概念。
只有一个全局名字空间
* 所有函数
* 所有数字变量
因此简单的使用字典就可以记录所有的信息了。
但是有一个问题:
如何区分普通的数字变量 和 引用意义上的数字.
执行 = 操作的语义如何处理.
'''
import operator
import sys
from interpretor.kernelc import lang... | Python |
#coding=utf8
#$Id: __init__.py 201 2008-06-03 03:03:11Z Filia.Tao@gmail.com $
lang_info = {
'name' : 'L0',
'path' : 'kernelc',
'suffix' : 'kec',
}
| Python |
#coding=utf8
#$Id: parse.py 84 2008-04-20 07:07:11Z Filia.Tao@gmail.com $
from ply import yacc
from interpretor.kernelc.lex import *
from interpretor.ast import Node,all_to_node
import interpretor.kernelc.error as error
start = 'prog'
def p_prog(p):
'''prog : prog fdef
| fdef
'''
... | Python |
#coding=utf8
#$Id: lang.py 84 2008-04-20 07:07:11Z Filia.Tao@gmail.com $
'''
KernelC 只有一个 int 类型。
同时数字有可以作为变量名。 使用* 操作符。
'''
import interpretor.kernelc.error as error
class Type:
def op_print(self, obj):
print obj.value,
def op_println(self, obj):
print obj.value
class Void(T... | Python |
#coding=utf8
#$Id: ast.py 203 2008-06-04 11:55:03Z Filia.Tao@gmail.com $
'''
AST Moudle
抽象语法树模块,提供
# 节结点
# 叶结点
# 子/父结点查询
# 导出成图片
# 通用遍历算法
# AST 线性化?
'''
class Node:
def __init__(self, type, children=[],prod = None):
self.type = type
self.children = [x for x in children... | Python |
#coding=utf8
#$Id: common.py 199 2008-05-30 13:53:45Z Filia.Tao@gmail.com $
from interpretor.ast import Node,Leaf,BaseASTWalker,BaseAnnotateAction
class CommonOPAnnotate(BaseAnnotateAction):
'''标注操作符类型
将 + => 'add' , '-' => 'sub' 等等
这个部分L1 和 L2 是一样的
'''
annotate_attr_name = 'op_name'
... | Python |
#coding=utf8
#$Id: __init__.py 95 2008-04-23 05:35:01Z Filia.Tao@gmail.com $
'''
几个语言的解释器
'''
version = '0.2'
author = 'Tao Fei (Filia.Tao@gmail.com)'
| Python |
#coding=utf8
#$Id: smallctest.py 199 2008-05-30 13:53:45Z Filia.Tao@gmail.com $
'''Unit Test For interpretor.smallc package'''
import unittest
from test import BaseTestCase, build_test_suit
def filter(f):
return True
return f.find("quicksort") != -1
if __name__ == '__main__':
unittest.TextT... | Python |
#coding=utf8
#$Id: kernelctest.py 205 2008-06-05 04:46:30Z Filia.Tao@gmail.com $
'''Unit Test For interpretor.ooc package'''
import unittest
from test import BaseTestCase, build_test_suit
def filter(f):
return True
#return f.find("sp") != -1
if __name__ == "__main__":
unittest.TextTestRunner(... | Python |
#coding=utf8
#$Id: ooctest.py 204 2008-06-04 12:56:45Z Filia.Tao@gmail.com $
'''Unit Test For interpretor.ooc package'''
import unittest
from test import BaseTestCase, build_test_suit
def filter(f):
#return True
return f.find("sp") != -1
if __name__ == "__main__":
unittest.TextTestRunner(verb... | Python |
#coding=utf8
#$Id: __init__.py 95 2008-04-23 05:35:01Z Filia.Tao@gmail.com $
'''
测试用公共函数
'''
import re
import StringIO
import unittest
import glob
import os
import sys
class BaseTestCase(unittest.TestCase):
def __init__(self, engine, source, input, expect):
'''source , input, expect 可以是类文... | Python |
#!/usr/bin/env python
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__version__ = "$Revision: 1.15 $"
__credits__ = 'functions in the datetools interface have a high degree of Matlab(TM) compatibility'
import datetime
import time
import math
import sys
import calendar
calendar.setfirstweekday(6)
if sys.ve... | Python |
#!/usr/bin/env python
# test_datetools.py
__version__ = "$Revision: 1.12 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
import support
from support import TODO, TestCase
if __name__ == '__main__':
support.adjust_path()
import datetools
import datetime
import time
class DateToolsTestCase(TestCase... | Python |
import types
import unittest
import sys
import os.path
import time
from unittest import _strclass
# Backwards compatibility for Python 2.3
#############################################################
try:
for t in unittest.TestSuite():
pass
except TypeError:
def TestSuite_iter(self):
return iter(self._tests)
... | Python |
#!/usr/bin/env python
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__version__ = "$Revision: 1.15 $"
__credits__ = 'functions in the datetools interface have a high degree of Matlab(TM) compatibility'
import datetime
import time
import math
import sys
import calendar
calendar.setfirstweekday(6)
if sys.ve... | Python |
#!/usr/bin/env python
import finpy
from finpy.financial import *
import datetools
cf1 = [536]
cf = cf1 * 145
cf.insert(0, -50600)
print '145 payments plan IRR is', finpy.irr(cf) * 100
cf1 = [1014]
cf = cf1 * 60
cf.insert(0, -50600)
print '60 payments plan IRR is', finpy.irr(cf) * 100
cf1 = [1842]
cf = cf1 * 245
c... | Python |
#!/usr/bin/env python
import finpy
from finpy.financial import *
import datetools
cf1 = [536]
cf = cf1 * 145
cf.insert(0, -50600)
print '145 payments plan IRR is', finpy.irr(cf) * 100
cf1 = [1014]
cf = cf1 * 60
cf.insert(0, -50600)
print '60 payments plan IRR is', finpy.irr(cf) * 100
cf1 = [1842]
cf = cf1 * 245
c... | Python |
#!/usr/bin/env python
# file pyvest.py
import datetime
import os.path
import data
from pysqlite2 import dbapi2 as sqlite
import pylab
__version__ = "$Revision: 1.10 $"
__author__ = "Ramesh Balasubramanian <ramesh@finpy.org>"
def compoundInterest(presentValue,
periodicRate,
... | Python |
#!/opt/ActivePython/bin/python
# daily.py
#--------------------------------------------------------------------------------------------
# Run this script from the same directory where treasury.db is located
#--------------------------------------------------------------------------------------------
__version__ = "$Re... | Python |
#!/opt/ActivePython/bin/python
# daily.py
#--------------------------------------------------------------------------------------------
# Run this script from the same directory where treasury.db is located
#--------------------------------------------------------------------------------------------
__version__ = "$Re... | Python |
#!/usr/bin/env python
#
# this file exists to make this directory look like a python module, so that treasury.db file
# can be loaded into YieldCurve class.
#
__version__ = "$Revision: 1.3 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
| Python |
#!/usr/bin/env python
#
# this file exists to make this directory look like a python module, so that treasury.db file
# can be loaded into YieldCurve class.
#
__version__ = "$Revision: 1.3 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
| Python |
#!/usr/bin/env python
#
#
#
__version__ = "$Revision: 1.20 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__doc__ = \
"""
_____ _ _ _ _____ _ _ ____________________________________________
| | |\\ | | | \\ / Finpy: Python Module for Financial Analysis
| | | \\ | | | \\ /... | Python |
#!/usr/bin/env python
# file pyvest.py
import datetime
import os.path
import data
from pysqlite2 import dbapi2 as sqlite
import pylab
__version__ = "$Revision: 1.10 $"
__author__ = "Ramesh Balasubramanian <ramesh@finpy.org>"
def compoundInterest(presentValue,
periodicRate,
... | Python |
#!/usr/bin/env python
#
#
#
__version__ = "$Revision: 1.20 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__doc__ = \
"""
_____ _ _ _ _____ _ _ ____________________________________________
| | |\\ | | | \\ / Finpy: Python Module for Financial Analysis
| | | \\ | | | \\ /... | Python |
#!/usr/bin/env python
# tvm.py
__version__ = "$Revision: 1.6 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
import math
import sys
def effrr(rate, numPeriods = 0):
"""
-------------------------------------------------------------------------------
Usage
return = effrr(rate, numPeriods)
continuou... | Python |
#!/usr/bin/env python
import math
import datetime
import datetools
import os.path
import finpy.data
from pysqlite2 import dbapi2 as sqlite
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__version__ = "$Revision: 1.14 $"
__credits__ = 'Interface defintion and comments based on MATLAB functions in financial to... | Python |
#!/usr/bin/env python
__version__ = "$Revision: 1.5 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
| Python |
#!/usr/bin/env python
# tvm.py
__version__ = "$Revision: 1.6 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
import math
import sys
def effrr(rate, numPeriods = 0):
"""
-------------------------------------------------------------------------------
Usage
return = effrr(rate, numPeriods)
continuou... | Python |
#!/usr/bin/env python
# currency.py
import math
__version__ = "$Revision: 1.2 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
def thirtytwo2dec(inNumber, inFraction):
"""
-------------------------------------------------------------------------------
Usage
Notes
Examples
--------------------... | Python |
#!/usr/bin/env python
# test_bond.py
__version__ = "$Revision: 1.3 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
import finpy
import unittest
class BondTestCase(unittest.TestCase):
def test_beytbill(self):
assert finpy.beytbill('11-Feb-2000', '8/7/00', 0.0577) == 0.0602
assert finpy.beytbill('11-... | Python |
#!/usr/bin/env python
# test_currency.py
__version__ = "$Revision: 1.2 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
import finpy
import unittest
import sys
class CurrencyTestCase(unittest.TestCase):
def test_thirtytwo2dec(self):
inNumbers = [101, 102]
inFractions = [25, 31]
outNumbers = [fi... | Python |
#!/usr/bin/env python
#
# this file exists to make this directory look like a python module
#
__version__ = "$Revision: 1.4 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__all__ = ['test_bond', 'test_tvm', 'test_currency'] | Python |
#!/usr/bin/env python
# test_tvm.py
__version__ = "$Revision: 1.4 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
import finpy
import unittest
class TvmTestCase(unittest.TestCase):
def test_effrr(self):
assert finpy.effrr(0.09, 12) == 0.0938
assert finpy.effrr(0.09) == 0.0942
def test_irr(self):... | Python |
#!/usr/bin/env python
#
# this file exists to make this directory look like a python module
#
__version__ = "$Revision: 1.4 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__all__ = ['test_bond', 'test_tvm', 'test_currency'] | Python |
#!/usr/bin/env python
import math
import datetime
import datetools
import os.path
import finpy.data
from pysqlite2 import dbapi2 as sqlite
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
__version__ = "$Revision: 1.14 $"
__credits__ = 'Interface defintion and comments based on MATLAB functions in financial to... | Python |
#!/usr/bin/env python
# currency.py
import math
__version__ = "$Revision: 1.2 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
def thirtytwo2dec(inNumber, inFraction):
"""
-------------------------------------------------------------------------------
Usage
Notes
Examples
--------------------... | Python |
#!/usr/bin/env python
__version__ = "$Revision: 1.5 $"
__author__ = 'Ramesh Balasubramanian <ramesh@finpy.org>'
| Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/license... | Python |
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | Python |
#!/usr/bin/env python
import codecs
import re
import jinja2
import markdown
def process_slides():
with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:
md = codecs.open('slides.md', encoding='utf8').read()
md_slides = md.split('\n---\n')
print 'Compiled %s slides.' % len(m... | Python |
#!/usr/bin/python
# encoding: utf-8
'''
fbtop.fbtop -- Top like tool for Firebird
'''
import os
import sys
from ui import Ui
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
__all__ = []
__version__ = 0.1
__date__ = '2013-05-19'
__updated__ = '2013-05-19'
DEBUG = 0
TESTRUN = 0
PR... | Python |
import copy
import urwid
import stats
class Text(object):
UPTIME = "Uptime: {0}, Firebird uptime: {1}"
ATTACHMENTS = "Attachments: {0}, Attachments/min: {1}"
FILE_HANDLES = "File handles: "
TX_PER_MIN = "Tx/min: "
FOOTER = "(q)uit"
class DatabaseColumn(object):
def __init__(self, hu... | Python |
#!/usr/bin/python
# encoding: utf-8
'''
fbtop.fbtop -- Top like tool for Firebird
'''
import os
import sys
from ui import Ui
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
__all__ = []
__version__ = 0.1
__date__ = '2013-05-19'
__updated__ = '2013-05-19'
DEBUG = 0
TESTRUN = 0
PR... | Python |
'''
Created on May 19, 2013
@author: john
'''
if __name__ == '__main__':
pass | Python |
'''
Created on May 19, 2013
@author: john
'''
from netifaces import interfaces, ifaddresses, AF_INET
import psutil
from psutil._error import NoSuchProcess, AccessDenied
import socket
from datetime import datetime, timedelta
import time
import re
from fdb import services
from uptime import uptime
class ServerError(Ex... | Python |
import os, shutil, zipfile
import releaseconf
APPNAME = "calculator"
PATH = releaseconf.PATH # example: "d:/code/firefoxcalculator/"
DEST = releaseconf.DEST # example: "d:/cave/release/firefoxcalculatorr/"
CALCVERSION = ['1.1.32', '1.1.31', '1.1.30', '1.1.29', '1.1.28', "1.1.27", "1.1.26", "1.1.25", "1.1.24", "1.1.... | 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 |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | Python |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | Python |
#!/usr/bin/env python
import optparse
import jwt
import sys
import json
import time
__prog__ = 'jwt'
__version__ = '0.1'
""" JSON Web Token implementation
Minimum implementation based on this spec:
http://self-issued.info/docs/draft-jones-json-web-token-01.html
"""
import base64
import hashlib
import hmac
try:
... | Python |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | Python |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | Python |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | Python |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | 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.