code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# Like bench_rtree but uses the libspatialindex c library. For comparison!
# http://pypi.python.org/pypi/Rtree
# TODO: path hackery.
if __name__ == "__main__":
import sys, os
mypath = os.path.dirname(sys.argv[0])
sys.path.append(os.path.abspath(os.path.join(mypath, "../../")))
from pyrtree.bench.bench_rtr... | Python |
import gc
# TODO: path hackery.
if __name__ == "__main__":
import sys, os
mypath = os.path.dirname(sys.argv[0])
sys.path.append(os.path.abspath(os.path.join(mypath, "../../")))
from pyrtree.rtree import RTree
from pyrtree.tests.test_rtree import RectangleGen,TstO
import time
# TODO: make these command-li... | Python |
import math
class Rect(object):
"""
A rectangle class that stores: an axis aligned rectangle, and: two
flags (swapped_x and swapped_y). (The flags are stored
implicitly via swaps in the order of minx/y and maxx/y.)
"""
__slots__ = ("x","y","xx","yy", "swapped_x", "swapped_y")
def __ini... | Python |
def take(n,f,*args,**kwargs):
i = 0
while i < n:
yield f(*args,**kwargs)
i = i + 1
| Python |
__all__ = ["rtree","rect"]
import rect
import rtree
Rect = rect.Rect
RTree = rtree.RTree
| Python |
#!/usr/bin/env python
from distutils.core import setup
setup(
name = "pyrtree",
packages = ["pyrtree"],
version = "0.50",
description = "2-Dimensional RTree spatial index",
author = "Dan Shoutis",
author_email = "dan@shoutis.org",
url="http://code.google.com/p/pyrtree",
long_descriptio... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# 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 ... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# 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 ... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | Python |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# 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 ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Locked file interface that should work on Unix and Windows pythons.
This module first tries to use fcntl locking to ensure serialized access
to a file, then falls back on a lock file if that is unavialable.
Usage:
f = LockedFile('filename', 'r+b', 'rb')
f.... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2011 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
__version__ = "1.0c2"
| Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2012 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# 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 writ... | Python |
__version__ = "1.0c2"
| Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# 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 l... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# 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 l... | Python |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | Python |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | Python |
"""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 |
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any later version.
#
#... | Python |
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any later version.
#
#... | Python |
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any later version.
#
#... | Python |
from AlienFX.AlienFXTexts import *
from AlienFXComputers import *
class AlienFXConfiguration:
def __init__(self):
self.name = "Default configuration"
self.area = {}
self.computer = ""
self.AlienFXTexts = AlienFXTexts()
def Create(self,name,computer,speed,path):
self.name = name
self.computer = comput... | Python |
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any later version.
#
#... | Python |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any ... | Python |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any ... | Python |
#!/usr/bin/python
import sys
class parser:
def __init__(self,path):
f = open(path)
self.string = f.readlines()
self.clean()
self.Strip()
self.Print()
def clean(self):
tmp = []
for l in xrange(len(self.string)):
if " " in self.string[l]:
tmp.append(self.string[l])
self.string = tmp
de... | Python |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any ... | Python |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#This file is part of pyAlienFX.
#
# pyAlienFX 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) any ... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | Python |
# Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | 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 |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import shutil
import sys
# Bump pyglet/__init__.py version as well.
VERSION = '1.2dev'
long_description = '''pyglet provides an object-oriented programming
interface for developing games and other visually-rich applicat... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import math
import warnings
import pyglet
import pyglet.image
try:
from pyglet.gl.VERSION_1_5 import *
except ImportError:
warnings.warn('OpenGL 1.5 or later is required collision detection. '\
'Please u... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import optparse
import os
import re
import subprocess
import sys
import parse
def create_swig_interface(header_filename, interface_filename,
includes=(), module_name=None, defines=()):
defines = l... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes as c
import gzip
import marshal
import sys
class AnonymousStruct(c.Structure):
__slots__ = ()
_fields_ = (
('foo', c.c_int),
)
class AnonymousUnion(c.Union):
__slots__ = ()
_fields_ = (... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import gzip
import cPickle as marshal
import optparse
import os
import sys
import xml.sax
def parse_type(type_string):
'''Get a tuple of the type components for a SWIG-formatted type.
For example, given the type "p.f(p.... | Python |
#!/usr/bin/python
# $Id:$
# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.
# Caveats:
# - Requires a filename (not from memory or stream yet). Looks like we need
# to manually implement a filter which provides an output IPin. Lot of
# work.
# - Theoretically can traverse the graph to... | Python |
#!/usr/bin/env python
# Play an audio file with QuickTime. Tested ok with MP3, WAV.
# Notes
# - Easy enough to read from a stream instead of filename, use DataRef
# interface
# - Not sure about playing same sound multiple times without reloading.
# - No direct support for OpenAL, could be tricky/impossible ... | Python |
#!/usr/bin/env python
'''
Ref: http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import util
import os
import time
def get_library(name):
path = util.find_library(name)
if not path:
# HACK libavformat/li... | Python |
from ctypes import *
from pyglet.gl import *
class GLSLException(Exception): pass
def glsl_log(handle):
if handle == 0:
return ''
log_len = c_int(0)
glGetObjectParameterivARB(handle, GL_OBJECT_INFO_LOG_LENGTH_ARB,
byref(log_len))
if log_len.value == 0:
return ''
log = ... | Python |
#!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
MAX_STREAMERS = 1000
if len(sys.argv) > 1:
MAX_STREAMERS = int(sys.argv[1])
MAX_ADD_STREAMERS = MAX_STREAMERS // 10
MIN_STREAMER_LENGTH... | Python |
#!/usr/bin/python
# $Id:$
import os
import sys
import time
sys.path.insert(0, os.path.dirname(__file__))
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import resource
from pyglet import window
from pyglet.window import key, mouse
from pyglet import graphics
from pyglet.text im... | Python |
#!/usr/bin/env python
from math import pi, sin, cos
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet.graphics import vertexdomain
from pyglet import window
try:
# Try and create a window with multisampling (antialiasing)
config = Config(sample_buffers=1, samples=4,
... | Python |
#!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
BARS = 100
if len(sys.argv) > 1:
BARS = int(sys.argv[1])
MIN_BAR_LENGTH = 4
MAX_BAR_LENGTH = 100
BAR_SEGMENT_HEIGHT = 10
UPDATE_PERIOD... | Python |
#!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import image
from pyglet import window
from pyglet.graphics import vertexdomain
if len(sys.argv) > 1:
SPRITES = int(sys.argv[1])
else:
SPRITES = 2000
SPRITE_IMAGE = 'examples/noisy/ball.png'
# Ho... | Python |
#!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
MAX_PARTICLES = 1000
if len(sys.argv) > 1:
MAX_PARTICLES = int(sys.argv[1])
MAX_ADD_PARTICLES = 100
GRAVITY = -100
win = window.Windo... | Python |
# ----------------------------------------------------------------------------
# Copyright (c) 2008 Andrew D. Straw and Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redist... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.window.carbon import CarbonEventHandler, carbon, _oscheck
from pyglet.window.carbon.constants import *
from pyglet.window.carbon.constants import _name
kEventTabletPoint = 1
kEventTabletP... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import pyglet
from pyglet import com
from pyglet.window.win32 import _kernel32
lib = ctypes.oledll.dinput8
LPVOID = ctypes.c_void_p
WORD = ctypes.c_uint16
DWORD = ctypes.c_uint32
LPDWORD = ctypes.POINTER(DWORD)
BOOL = ctypes.c_int
WCHAR = ctypes.c_wchar
UINT ... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import pyglet
lib = ctypes.windll.wintab32
LONG = ctypes.c_long
BOOL = ctypes.c_int
UINT = ctypes.c_uint
WORD = ctypes.c_uint16
DWORD = ctypes.c_uint32
WCHAR = ctypes.c_wchar
FIX32 = DWORD
WTPKT = DWORD
LCNAMELEN = 40
class AXIS(ctypes.Structure):
_... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import input
# (usage_page, usage): Device class
'''
device_usage_map = {
(0x01, 0x01): input.PointerDevice,
(0x01, 0x01): input.MouseDevice,
(0x01, 0x04): input.JoystickDevice,
(0x01, 0x05): input.GamePadDevice,... | Python |
#!/usr/bin/env python
'''Event constants from /usr/include/linux/input.h
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
EV_SYN = 0x00
EV_KEY = 0x01
EV_REL = 0x02
EV_ABS = 0x03
EV_MSC = 0x04
EV_LED = 0x11
EV_SND = 0x12
EV_REP = 0x14
EV_FF = 0x15
EV_PWR = 0x16
EV_FF_STATUS = 0x17
EV_MAX = 0x1f
# Synchro... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.libs.darwin import carbon, _oscheck, create_cfstring
from pyglet.libs.darwin.constants import *
import input
import usage
# non-broken c_void_p
void_p = ctypes.POINTER(ctypes.c_int)
cla... | Python |
'''Wrapper for Xi
Generated with:
tools/genwrappers.py xinput
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xi')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
# Some b... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import pyglet
import input
devices = input.get_devices()
show_all = True
window = pyglet.window.Window(1024, 768)
batch = pyglet.graphics.Batch()
class TrackedElement(object):
def __init__(self, element):
self.elem... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import sys
class InputException(Exception):
pass
class InputDeviceExclusiveException(InputException):
pass
if sys.platform == 'darwin':
import osx
get_devices = osx.get_devices
elif sys.platform == 'linux2':
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from fcntl import ioctl
import array
import ctypes
import errno
import os
import struct
import sys
import pyglet
from linux_const import *
c = ctypes.cdll.LoadLibrary('libc.so.6')
_IOC_NRBITS = 8
_IOC_TYPEBITS = 8
_IOC_SIZEBITS... | Python |
'''Wrapper for avcodec
Generated with:
../tools/wraptypes/wrap.py /usr/include/ffmpeg/avcodec.h -o lib_avcodec.py -lavcodec
.. Then hacked. DO NOT REGENERATE.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
from avcodec import get_library
_lib = get_library('avcodec... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from timeit import Timer
NUMBER=100000
setup='''
from pyglet.gl.VERSION_1_1 import glBindTexture, glEnable, GL_TEXTURE_2D
from pyglet.gl.VERSION_1_1 import glBegin, glEnd, glVertex2f, GL_LINES
from pyglet.window import Window
fro... | Python |
#!/usr/bin/python
# $Id:$
from docutils.core import publish_doctree
from docutils import nodes
import pyglet
from pyglet.text.formats import structured
class Stylesheet(object):
default = dict(
font_name='Times New Roman',
font_size=12,
margin_bottom=12)
emphasis = dict(
ital... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import math
import optparse
import pyglet
root2 = math.sqrt(2)
def gen_dist_field(img, width, height, spread, bidirectional=True):
sample_width = img.width // width
sample_height = img.height // height
max_dist = spread * root2
dist_scale = 127. / max_dist
... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import sys
import pyglet
from pyglet.window import key
from pyglet.gl import *
class Shader(object):
'''Generic shader loader.'''
def __init__(self, vertex_source, fragment_source=None):
vertex_shader = self._create_shader(GL_VERTEX_SHADER, vertex_source)
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import code
import sys
import traceback
import pyglet.event
import pyglet.text
from pyglet.window import key
from pyglet.gl import *
class Console(object):
def __init__(self, width, height, globals=None, locals=None):
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import math
import warnings
from OpenGL.GL import *
class DrawingContext(object):
__slots__ = ['transitions']
def __init__(self):
self.transitions = []
def draw(self, widget):
if widget.transition:
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from math import *
from ctypes import *
from pyglet.gl import *
from euclid import *
def FloatArray(*args):
t = (c_float * len(args))
return t(*args)
def IndexArray(*args):
t = (c_uint * len(args))
return t(*args... | 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.