code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
from django.conf import settings
def path_context_processor(request):
path = {
'PATH': settings.APP_PATH,
}
return path | Python |
# -*- encoding: utf-8 -*-
DATE_FORMAT = 'N j, Y' | Python |
# -*- coding: utf-8 -*-
DATE_FORMAT = r'j N Y'
| Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option)... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
import sys
import os
sys.path.append('/usr/django')
os.environ["CELERY_LOADER"] = "django"
os.environ['DJANGO_SETTINGS_MODULE'] = 'video365.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
| Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
'''
Copyright Cobalys.com (c) 2011
This file is part of 365Video.
365Video is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '3dlp_slicer.ui'
#
# Created: Sat Jun 01 20:47:44 2013
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'manual_control_gui.ui'
#
# Created: Mon May 06 20:43:40 2013
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.... | Python |
#!/usr/bin/env python
#
# build_arduino.py - build, link and upload sketches script for Arduino
# Copyright (c) 2010 Ben Sasson. All right reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | Python |
#!/usr/bin/env python
#
# build_arduino.py - build, link and upload sketches script for Arduino
# Copyright (c) 2010 Ben Sasson. All right reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'settingsdialog.ui'
#
# Created: Mon May 13 19:24:11 2013
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.from... | Python |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
### BITPIM
###
### Copyright (C) 2003-2004 Roger Binns <rogerb@rogerbinns.com>
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of the BitPim license as detailed in the LICENSE file.
###
### $Id$
"""Detect... | Python |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 17 21:01:39 2012
@author: Chris Marion
"""
import serial
import math
import time
from threading import Thread
class Heartbeat(Thread):
def __init__(self, parent):
self.stopped = False
self.parent = parent
Thread.__init__(self)
... | Python |
import slicer
import vtk
import sys
from PyQt4 import QtCore,QtGui
from PyQt4.Qt import *
from PyQt4.QtGui import QFileDialog, QPixmap, QSplashScreen
#from PyQt4.Qt import *
from slicer_gui import Ui_MainWindow
from slicer_settings_dialog_gui import Ui_Dialog
from vtk.qt4.QVTKRenderWindowInteractor import QVTK... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'slicer_settings_dialog.ui'
#
# Created: Sun Mar 31 19:34:46 2013
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QStr... | Python |
import vtk
import time
import os
import ConfigParser
import cPickle as pickle
import zipfile
import StringIO
import numpy
import Image
from vtk.util.numpy_support import vtk_to_numpy
class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): #defines all the mouse interactions for the render views
... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'aboutdialog.ui'
#
# Created: Sun Mar 03 18:00:57 2013
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '3dlp_v2.ui'
#
# Created: Sun Jun 30 18:26:15 2013
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
e... | Python |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 11 13:35:14 2012
@author: Chris Marion - www.chrismarion.net
"""
from PyQt4 import QtCore, QtGui
from PyQt4.Qt import *
#class for slideshow window
class SlideShowWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
def set... | Python |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 05 22:20:39 2012
@author: Chris Marion Copyright 2012-2013
www.chrismarion.net
Still to add/known issues:
-projector control functionality is not finished.
-still looking for a good method of calibrating for X and Y (image size)
-raise the bed to a ... | Python |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 18 17:06:39 2012
@author: Chris
"""
from PyQt4 import QtCore,QtGui
from PyQt4.Qt import *
import re, os, hardware
from slideshowgui import SlideShowWindow
from time import sleep
class printmodel(QtCore.QThread):
def __init__(self, zscript, COM_Port, ... | Python |
## Pre-defined animation.
##
## Move selected object to the top right corner.
import animation
from keyframe import PosKeyFrame
def anim_topRight(firstFrame, lastFrame, nFrames):
#self.firstFrame = firstFrame
#self.lastFrame = lastFrame
#self.nframes = nframes
anim = animation.Animation ([Pos... | Python |
## Pre-defined animation.
##
##class DefAnimTransRot():
import animation
from keyframe import PosKeyFrame, RotKeyFrame
## FUTURO - Chamar bringObj.py
## * The code bellow is responsable for creating keyframe animation structure to bring an' object near to the user.
def anim_bringObj(firstFrame, lastFrame, nFra... | Python |
# -*- coding: utf-8 -*-
## This code is responsable for creating keyframe animation structure.
## Master Research: Elisabete Thomaselli Nogueira
## Professor: Claudio Esperanca
## Graduate Student: Victor Soares Bursztyn
## Created in: 13-03-08
## Last updated in:
class KeyFrame:
... | Python |
# -*- coding: utf-8 -*-
## This code is responsable for creating keyframe animation structure.
## Master Research: Elisabete Thomaselli Nogueira
## Professor: Claudio Esperanca
## Graduate Student: Victor Soares Bursztyn
## Created in: 13-02-08
## Last updated in:
from scipy import *
... | Python |
class c:
def __init__(self):
self.a = 1
def geta (self) : return self.a
def seta (self,val) : self.a = val
class d:
def __init__(self,getter,setter):
self.getter = getter
self.setter = setter
def update (self):
self.setter (self.getter()+1)
c0=c()
d0=d(c0.g... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interfAnim_sem_Delay_sem_Graph.ui'
#
# Created: Fri May 02 01:04:07 2008
# by: PyQt4 UI code generator 4.1.1
#
# WARNING! All changes made in this file will be lost!
import sys
from PyQt4 import QtCore, QtGui
class Ui_Dial... | Python |
# -*- coding: utf-8 -*-
## This code is responsable for creating keyframe animation structure.
## Master Research: Elisabete Thomaselli Nogueira
## Professor: Claudio Esperanca
## Graduate Student: Victor Soares Bursztyn
## Created in: 13-03-08
## Last updated in:
## Rotine responsable for imp... | Python |
## Pre-defined animation.
##
##class DefAnimTransRot():
import animation
from keyframe import PosKeyFrame, RotKeyFrame
def anim_TransRot(firstFrame, lastFrame, nFrames):
#self.firstFrame = firstFrame
#self.lastFrame = lastFrame
#self.nframes = nframes
anim = animation.Animation ([PosKeyFrame ... | Python |
# -*- coding: utf-8 -*-
## This code is responsable for creating keyframe animation structure.
## Master Research: Elisabete Thomaselli Nogueira
## Professor: Claudio Esperanca
## Graduate Student: Victor Soares Bursztyn
## Created in: 13-03-08
## Last updated in:
## Rotine responsab... | Python |
#!/usr/bin/env python
"""extremely simple demonstration playing a soundfile
and waiting for it to finish. you'll need the pygame.mixer
module for this to work. Note how in this simple example we
don't even bother loading all of the pygame package. Just
pick the mixer for sound and time for the delay function."""... | Python |
# -*- coding: utf-8 -*-
## ******************************************************************* GLWIDGET.PY
## * Description:
## * The code contained in this file is meant to handle all the elements
## * (events, routines and classes) that exist in the glwidget canvas.
## ************************************************... | Python |
#!/usr/bin/env python
"""extremely simple demonstration playing a soundfile
and waiting for it to finish. you'll need the pygame.mixer
module for this to work. Note how in this simple example we
don't even bother loading all of the pygame package. Just
pick the mixer for sound and time for the delay function."""... | Python |
#!/usr/bin/env python
"""extremely simple demonstration playing a soundfile
and waiting for it to finish. you'll need the pygame.mixer
module for this to work. Note how in this simple example we
don't even bother loading all of the pygame package. Just
pick the mixer for sound and time for the delay function."""... | Python |
#!/usr/bin/env python
"""extremely simple demonstration playing a soundfile
and waiting for it to finish. you'll need the pygame.mixer
module for this to work. Note how in this simple example we
don't even bother loading all of the pygame package. Just
pick the mixer for sound and time for the delay function."""... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interfQtPrototipo.ui'
#
# Created: Tue Apr 15 21:47:42 2008
# by: PyQt4 UI code generator 4.1.1
#
# WARNING! All changes made in this file will be lost!
import sys
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object... | Python |
import scene.vector as vector
from math import *
__all__ = ["ArcBall"]
class ArcBall(object):
"""Implements an arcball manipulator for specifying rotations."""
def __init__(self, center, radius):
"""Creates a new arcball manipulator.
@param center: Triple of coordinates of center point ... | Python |
# -*- coding: utf-8 -*-
## ****************************************************************** PROTOTIPO.PY
## * Description:
## * 3DbyStep main window calls.
## * The code bellow is very simplistic. It only shows a small window.
## *******************************************************************************
## * Cre... | Python |
# -*- coding: utf-8 -*-
## ************************************************************* INTERFBEHAVIOR.PY
## * Description:
## * This code is responsable for treat application buttons Behaviors.
## * (events, routines and classes) that exist in the glwidget canvas.
## **************************************************... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interfTextDoc.ui'
#
# Created: Tue May 6 08:09:59 2008
# by: PyQt4 UI code generator 4.3.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog_Doc(object):
def setupUi(self, Di... | Python |
# -*- coding: utf-8 -*-
## This code is responsable for creating visual element structures to support other 3DbyStep routines.
## dispose a group of interations inside these environment.
## Master Research: Elisabete Thomaselli Nogueira
## Professor: Claudio Esperanca
## Graduate student: V... | Python |
"""
Implementation of a very simple set of classes for representing objects in a
given scene. Most of the attributes and properties model OpenGL primitives and
state variables, so that their meaning is mostly self-documenting. The idea here
is that objects may be passed around or maybe stored (using pickle or something... | Python |
__all__=["Cube"]
from mesh import Mesh
import vector
from bbox import *
class Cube(Mesh):
"""A Cube of side length 2 centered at the origin."""
face = [[3, 2, 1, 0], [7, 6, 2, 3], [4, 5, 6, 7],
[0, 1, 5, 4], [1, 2, 6, 5], [3, 0, 4, 7] ]
vertex = [[-1, -1,1],[-1, -1,-1], [-1,1,-1], [-1,1,1],
... | Python |
__all__=["Sphere"]
from OpenGL.GL import *
from OpenGL.GLU import *
from graphicobject import *
from bbox import *
class Sphere(GraphicObject):
"A Sphere of a given radius."
def __init__(self,radius=1, material=None, transformation=None):
"""Constructor.
@param radius: sphere radius.
... | Python |
"""
Various mesh loaders. Each function receives a filename which points to
a file in some format and returns a Mesh object.
"""
__all__=["loadoff"]
from graphicobject import *
from mesh import *
def loadoff (filename,invertCirculations=False):
"""Reads an off file and returns a corresponding Mesh object.
@p... | Python |
"""
Light sources.
"""
__all__ = ["Light"]
from OpenGL.GL import *
from graphicobject import *
# Some globals
defaultLightAmbient = (0,0,0,1)
defaultLightDiffuse = (1,1,1,1)
defaultLightSpecular = (1,1,1,1)
defaultLightPosition = (0,0,1,0)
class Light(object):
"Represents a positional or directional light source... | Python |
from math import sqrt
def sub(v1,v2):
"""Difference of two vectors.
@param v1: first vector
@param v2: second vector
@return: v1 - v2
"""
return [a-b for a,b in zip(v1,v2)]
def add(v1,v2):
"""Sum of two vectors.
@param v1: first vector
@param v2: second vector
@return: v1 - ... | Python |
__all__ = ["Mesh"]
from graphicobject import *
from halfedge import *
from OpenGL.GL import *
from bbox import *
from math import sqrt
class Mesh(GraphicObject):
"A Mesh object"
def __init__(self,face=[],vertex=[],
drawmode="fill",normalmode="face",
material=None,transfo... | Python |
__all__=["HandleBox"]
from OpenGL.GL import *
from OpenGL.GLU import *
from graphicobject import *
class HandleBox(GraphicObject):
"""This object is to be used as a manipulator for other graphicobjects.
The idea is that each handlebox object is attached to some other object.
Altering the transformation o... | Python |
"""Several matrix utilities."""
import vector
from math import *
def cofactor(m,irow,icol):
"""Returns the cofactor icol,irow of matrix m."""
def minor():
"""Returns a minor matrix of m, where row irow and col icol were removed."""
return [row[:icol]+row[icol+1:] for row in m[:irow]+m[irow+1:]... | Python |
from EditableVisualElement import EditableVisualElement, visualElement
from graphicobject import GraphicObject, GraphicObjectCollection
from cube import Cube
from sphere import Sphere
from material import Material
from mesh import Mesh
from halfedge import Halfedge,HalfedgeDS
from light import Light
from bbox import Bo... | Python |
"""
An implementation of the halfedge data structure, sometimes known as the
*DCEL* (double connected edge list). It is capable of storing the topology of
(planar?) graphs, which makes it very useful for handling polyedra, for instance.
"""
__all__=["Halfedge","HalfedgeDS"]
from managedlist import ManagedList
cl... | Python |
"""
Stuff to do with bounding boxes.
"""
__all__ = ["BoundingBox"]
from OpenGL.GL import *
from math import *
import matrix
class BoundingBox(object):
"""A Bounding Box. Used to approximate the locus of a graphic object."""
def __init__ (self, center=(0,0,0), side=(0,0,0)):
"""Constructor
@pa... | Python |
"""
Implementation of a very simple set of classes for representing objects in a
given scene. Most of the attributes and properties model OpenGL primitives and
state variables, so that their meaning is mostly self-documenting. The idea here
is that objects may be passed around or maybe stored (using pickle or somethin... | Python |
"""
Implementation of a list with stable index positions.
"""
class ManagedList(list):
"""This is a list where index positions are stable, i.e, whenever an element
is removed (with del), the array is not shrunk, but rather, the position is
marked as free. On the other hand, rather than appending, one may i... | Python |
"""
Material properties of objects.
"""
__all__=["Material"]
from OpenGL.GL import *
defaultMaterialDiffuse = (0.8, 0.8, 0.8, 1.0)
defaultMaterialAmbient = (0.2, 0.2, 0.2, 1.0)
defaultMaterialSpecular = (0,0,0,1)
defaultMaterialEmission = (0,0,0,1)
defaultMaterialShininess = 0
class Material(object):
"A Material... | Python |
"""
ArcBall.py -- Math utilities, vector, matrix types and ArcBall quaternion rotation class
Would not it be great to rotate your model at will, just by using the mouse?
With an ArcBall you can do just that.
This implementation of the ArcBall class based on Bretton Wade is, which is based on Ken Shoemake implementa... | Python |
import wx
from wx import glcanvas
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
import sys,math
name = 'ball_glut'
class myGLCanvas(glcanvas.GLCanvas):
def __init__(self, parent):
#wx.EvtHandler.__init__(self)
glcanvas.GLCanvas.__init__(self, parent,-1)
wx.EVT_... | Python |
class CanvasSettings:
nearZ = 1.0
farZ = 1000.0
fov = 40.0
class Settings:
canvas = CanvasSettings()
settings = Settings()
| Python |
class ObjectRegistry(object):
def __init__(self):
self.oidGObjectmap = {}
self.count = 0
def register(self, gobject):
self.count += 1
self.oidGObjectmap[self.count] = gobject
return self.count
def getGObject(self, oid):
return self.oidGObjectmap.get... | Python |
import logging
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
#The background is set with 40 plus the number of the color, and the foreground with 30
#These are the sequences need to get colored ouput
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def formatter_message(messag... | Python |
from math import sin, cos, sqrt, atan2
dotp = lambda u, v: sum([u[i]*v[i] for i in range(3)])
scalarp = lambda s, v: tuple([s*v[i] for i in range(3)])
vsum = lambda u, v: tuple([u[i] + v[i] for i in range(3)])
vdiff = lambda u, v: tuple([u[i] - v[i] for i in range(3)])
mag = lambda v: sqrt(sum([v[i]*v[i... | Python |
from time import time
class TimeStat(object):
def __init__(self):
self.tsdata = {}
def __call__(self, func, name=None):
name = func.__name__ if not name else name
self.tsdata[name] = (0, 0, 0, 0)
def wrapper(*args, **kw):
ts = time()
t... | Python |
import FTGL
import os
from logger import log
class Fonts(object):
def __init__(self):
self.fontRef = {}
self.uiFonts = []
def __call__(self, fontfilename, fonttype, size):
f = self.fontRef.get((fontfilename, fonttype, size), None)
if f:
ret... | Python |
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from random import random, randint
from gobjects import Sphere, GObject, Tetrahedron, \
Cylinder, Scene, Arrow
from fonts ... | Python |
#!/usr/bin/python
import sys
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import FTGL
fonts = []
width = 600
height = 600
def do_ortho():
w, h = width, height
glViewport(0, 0, w, h)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
size = max(w, h) / 2.0
aspect = fl... | Python |
COLOR_GREY = (0.6, 0.6, 0.6, 1.0)
COLOR_BLACK = (0.0, 0.0, 0.0, 1.0)
COLOR_WHITE = (1.0, 1.0, 1.0, 1.0)
GEN_GREY = lambda x: (x, x, x, 1.0)
| Python |
#########################################################
##
##
## OpenGl Canvas for drawing stereo 3D images and
## handling mouse and keyboard control
##
##
#########################################################
import wx
import traceback
from OpenGL.GL import *
from OpenGL.GLU import... | Python |
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from math import sin, cos, pi, exp, floor, sqrt, atan2
from logger import log
from timestat import timestat
from vector import dotp, scal... | Python |
from gobjects import GObject
from fonts import regularFont
class Text(GObject):
def __init__(self, x=0, y=0, z=0, text='', **kw):
GObject.__init__(self, x, y, z, **kw)
self.text = text
def render(self):
glPushMatrix()
glTranslatef(*self.translation)
... | Python |
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from colors import COLOR_BLACK, COLOR_GREY, COLOR_WHITE, GEN_GREY
from objectregistry import objectRegistry
from logger import log
from math imp... | Python |
#
# Program to find new coordinates when the angle of a point is compressed
# to half original value in the negative z direction
#
import math
def compressAngle(x,y,z):
r = math.sqrt(x*x + y*y + z*z)
zn = - math.sqrt(0.5*(r*(r - z) ))
xn = r*(math.sqrt((1+math.sqrt(1 - x*x/(r*r)))/2))
yn = r*(math.sq... | Python |
# Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, ... | Python |
# ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008
# David Turner <david@freetype.org>
from sources import *
from content import *
from formatter import *
import time
# The following defines the HTML header used by all generated pages.
html_header_1 = """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/... | Python |
#!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | Python |
#!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | Python |
#!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | Python |
# Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
#
# this file contains definitions of classes needed to decompose
# C sources files into a series of multi-line "blocks". There are
# two kinds of blocks:
#
# - normal blocks, which contain source code or ordinary comment... | Python |
# Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | Python |
# Content (c) 2002, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
# This file contains routines used to parse the content of documentation
# comment blocks and build more structured objects out of them.
#
from sources import *
from utils import *
import string, re
# this regular expression... | Python |
#!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | Python |
# compute arctangent table for CORDIC computations in fttrigon.c
import sys, math
#units = 64*65536.0 # don't change !!
units = 256
scale = units/math.pi
shrink = 1.0
comma = ""
def calc_val( x ):
global units, shrink
angle = math.atan(x)
shrink = shrink * math.cos(angle)
return angle/math.pi *... | Python |
#!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... | Python |
#!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... | Python |
#!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... | Python |
#!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... | Python |
import bpy
data_dictionary = '/mnt/storage/Projects/3dconomy/data/'
datafile = 'us_data.txt'
# datafile = 'cdn_data.txt'
# datafile = 'eu_data.txt'
def InitFunction():
line_data_list = []
dataset = open(data_dictionary + datafile)
for line in dataset:
items = line.split(",")
line_data_list.append(items)
dat... | Python |
import os, sys
import OpenEXR
import Imath
import math
import time
import numpy as np
from numpy import array
import myextension
from readEXR import *
from writeEXR import *
from MRF_Utils import *
# this function will return the indices of the new localImage, whose area is 1.5 times bigger than the bounding box of... | Python |
import numpy as np
def positionFeature(labels, Nth):
tmp = np.where(labels == Nth)
return np.mean(tmp[0]),np.std(tmp[0]),np.mean(tmp[1]),np.std(tmp[1])
def colorFeature(L,labels, Nth):
tmp = np.where(labels == Nth, L)
return np.mean(tmp),np.std(tmp)
def features( L,labels, Nth )... | Python |
import myextension
import numpy as np
import ctypes
a = np.arange(4*3*2).reshape(4,3,2) * 5.0
b = np.arange(4*3*2).reshape(4,3,2) * 1.0 # double array !
#print myextension.MRF(a,b)
a = np.arange(4*3).reshape(4,3) * 1.1
b = np.arange(4*3).reshape(4,3) * 5.2 # double array !
c = np.arange(4*3).reshape(4,3) *... | Python |
import numpy as N
from numpy.ctypeslib import load_library
from numpyctypes import c_ndarray
import ctypes as C
mylib = load_library('libMRF', '../cpp/') # '.' is the directory of the C++ lib
def MRF(array1, array2):
arg1 = c_ndarray(array1, dtype=N.double, ndim = 3)
arg2 = c_ndarray(array2, dtype=N.d... | 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.