code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
"""DisjointSets.py
Description:
Based on details provided by: http://en.wikipedia.org/wiki/Disjoint-set_data_structure
and modified based on notes of CS 473 Algorithms course by University of Illinois.
Finally adapted to Kruskal problem presented by course 75.29 Teoria de Algoritmos on
University of Buenos Aires.
... | Python |
import re
import heapq
from UnionFind import UnionFind
from DisjointSets import *
class Edges:
def __init__(self, vertex1, vertex2, weight):
self.vertex1 = vertex1
self.vertex2 = vertex2
self.weight = weight
class Vertex:
def __init__(self, value):
self.value = value
def __str__(self):
return self.val... | Python |
"""Graph.py
Description:
Simple, undirected and connected graph implementation for course 75.29
Teoria de Algoritmos at University of Buenos Aires. Provide simple graph
operations, calculates the minimum spanning tree using Kruskal algorithm
and work with Union and Set dataStructures defined on DisjointSet code,
which ... | Python |
from Graph import Graph
def main():
graphFile = raw_input("Enter the file name containing a valid graph:")
filep = open(graphFile)
graph = Graph(filep)
print "Evaluating the graph:\n"
print graph
T = graph.kruskal()
print "Min. Spanning tree: \n"
for edges in T:
print edges
return 0
if __name__ == '__mai... | Python |
"""UnionFind.py
Union-find data structure. Based on Josiah Carlson's code,
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/215912
with significant additional changes by D. Eppstein.
"""
class UnionFind:
"""Union-find data structure.
Each unionFind instance X maintains a family of disjoint sets of
... | Python |
"""DisjointSets.py
Description:
Based on details provided by: http://en.wikipedia.org/wiki/Disjoint-set_data_structure
and modified based on notes of CS 473 Algorithms course by University of Illinois.
Finally adapted to Kruskal problem presented by course 75.29 Teoria de Algoritmos on
University of Buenos Aires.
... | Python |
#!/usr/bin/env python
import sys
class node:
def __init__(self, number, bits = 0, time = 0):
self.bits = bits
self.time = time
self.id = number
def __cmp__(self, other):
if self.bits > other.bits:
return 1
elif self.bits < other.bits:
return -1
return 0
def __str__(self):
return "("+ "ID: "+ st... | Python |
#!/usr/bin/env python
import sys
class node:
def __init__(self, number, bits = 0, time = 0):
self.bits = bits
self.time = time
self.id = number
def __cmp__(self, other):
if self.bits > other.bits:
return 1
elif self.bits < other.bits:
return -1
return 0
def __str__(self):
return "("+ "ID: "+ st... | Python |
#!/usr/bin/env python
import sys
class node:
def __init__(self, number, bits = 0, time = 0):
self.bits = bits
self.time = time
self.id = number
def __cmp__(self, other):
if self.bits > other.bits:
return 1
elif self.bits < other.bits:
return -1
return 0
def __str__(self):
return "("+ "ID: "+ st... | Python |
#!/usr/bin/env python
import sys
class node:
def __init__(self, number, bits = 0, time = 0):
self.bits = bits
self.time = time
self.id = number
def __cmp__(self, other):
if self.bits > other.bits:
return 1
elif self.bits < other.bits:
return -1
return 0
def __str__(self):
return "("+ "ID: "+ st... | Python |
#!/usr/bin/python
import sys
class Edge(object):
def __init__(self, u, v, w):
self.source = u
self.sink = v
self.capacity = w
def __repr__(self):
return "%s->%s:%s" % (self.source, self.sink, self.capacity)
class FlowNetwork(object):
def __init__(self, path_file):
fd = ... | Python |
#!/usr/bin/python
import sys
class Edge(object):
def __init__(self, u, v, w):
self.source = u
self.sink = v
self.capacity = w
def __repr__(self):
return "%s->%s:%s" % (self.source, self.sink, self.capacity)
class FlowNetwork(object):
def __init__(self, path_file):
fd = ... | Python |
LEFT = 0
HEIGHT = 1
RIGHT = 2
def skyline(buildings):
if len(buildings) == 1:
keypoints= []
keypoints.append((buildings[0][LEFT],buildings[0][HEIGHT]))
keypoints.append((buildings[0][RIGHT],0))
return keypoints
keypoints = []
ListA = skyline(buildings[(len(buildings)/2):])
ListB = skyline(buildings[:(len... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
class logger:
def __init__(self):
self.logfile = open("LOG", "w")
def dump(self, *data):
line = "-".join(map(str, data))
self.logfile.write(line + "\n")
def __del__(self):
self.logfile.close()
mylogger = logger()
def inventory(W, ms, cs, co, kmax... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
class logger:
def __init__(self):
self.logfile = open("LOG", "w")
def dump(self, *data):
line = "-".join(map(str, data))
self.logfile.write(line + "\n")
def __del__(self):
self.logfile.close()
mylogger = logger()
def inventory(W, ms, cs, co, kmax... | Python |
# coding=latin-1
'''
@author: Leonardo Val <lval@ucu.edu.uy>
'''
class Game(object): ###########################################################
''' Base class for all game components. The instance represents a game state,
including information about the board, the pieces, the players and any
... | Python |
# coding=latin-1
''' Contests are sets of matches between many agents. Its purpose its to
evaluate each agents in comparison with the others.
Each contests its arranged in a different way.
@author: Leonardo Val <lval@ucu.edu.uy>
'''
import itertools, random, collections
from _base import mat... | Python |
# coding=latin-1
''' Implementacion del juego Toads and Frogs
@author: Mariana Maceiras <mmaceira@ucu.edu.uy>
'''
from _utils import resultado, print_board, coord_id
from _base import Game
from _tests.test_games import GameTest
class Toads_Frogs(Game):
''' Game component for Toads and Frogs
'''... | Python |
# coding=latin-1
'''
@author: Leonardo Val <lval@ucu.edu.uy>
'''
import sys
import random
from utils import *
from _utils import randgen
class Agent(object): ###########################################################
''' Base class for agents participating in games.
'''
def __init_... | Python |
from utils import *
HEURISTIC_MAX_VALUE = 350.0
PORCENTAJES_COLUMNAS = [0.25, 0.50, 1.0, 0.50,0.25]
class heuristic_wrap():
def __init__(self, genotipo = None):
self.genotipo = genotipo
def heuristicaDistanciaDestino(self, agente, game, depth):
acumulador = 0
for i in... | Python |
'''
Created on Mar 29, 2011
@author: diego
'''
from globals import *
from fileUtils import *
from threading import Thread
import time
def printTablero(tablero):
print("\n")
for i in range(filas):
print tablero[i]
print("\n")
def printTableroHTML(tablero, file = "output.h... | Python |
'''
Created on Mar 30, 2011
@author: diego
'''
def writeToOutput(data, file = "output.html"):
try:
fileHandler = open(file,'w')
fileHandler.write(data)
fileHandler.close()
except IOError:
print "Error al escribir" | Python |
'''
Created on Mar 29, 2011
@author: diego
'''
from utils import *
iniciarTablero()
printTableroHTML()
print("Ingrese la posicion de la ficha que desea mover seguido del numero de posicion disponible.")
print("Una ficha se indica con una tupla. Ej: (1,2,3) es la ficha en fila 1 columna 2")
print("Eje... | Python |
from pyevolve import G1DList, Crossovers, Mutators
from pyevolve import GSimpleGA
from pyevolve import Selectors
from pyevolve import Statistics
from pyevolve import DBAdapters
from heuristicas import *
from pyevolve import Initializators, Mutators, Consts
import five_field_kono
from juegos._contests import *
... | Python |
# This code is part of Pyevolve.
# Require matplotlib v.0.98.5.0+
from optparse import OptionParser
from optparse import OptionGroup
STAT = {
"identify" : 0, "generation" : 1, "rawMin" : 2,
"fitMin" : 3, "rawDev" : 4, "fitMax" : 5,
"rawMax" : 6, "fitAve" : 7, "rawVar" : 8... | Python |
'''
Created on Apr 8, 2011
@author: diego
'''
from _tests.test_games import GameTest
from juegos._agents import AlphaBetaAgent, Agent
from juegos._base import Game
from juegos._utils import resultado
from utils import *
class Five_field_kono(Game):
PLAYERS = (BLANCAS,NEGRAS)
def ... | Python |
'''
Created on Mar 29, 2011
@author: diego
'''
import random
filas = 5
#En el tablero el jugador de IA es marcado con M
NEGRAS = 'N'
#En el tablero el jugador de IA es marcado con M
BLANCAS = 'B'
#Las posiciones de maquina son los casilleros originales que ocupan las fichas del jugador maquina
posi... | Python |
from tree import tree_node as node
from tree import tree_node
from tree import tree_edge as egde
from tree import tree
from copy import deepcopy
class specie(tree_node):
def __init__(self, r = None, name = None, theta = None):
node.__init__(self)
self.R = set()
self.name = name
self.theta = theta
if... | Python |
from graph import node, edge, graph
from copy import deepcopy, copy
class tree_node(node):
def __init__(self, name = None):
node.__init__(self)
self.sons = []
self.father = None
self.name = name
class tree_edge(edge):
def __init__(self, source, destination, data = None):
edge.__init__(self, [... | Python |
class node:
def __init__(self, data = None):
self.data = data
class edge:
def __init__(self, sources, destinations, data = None):
self.sources = sources
self.destinations = destinations
self.data = data
class graph:
def __init__(self):
self.root = None
self.nodes = set()
self.edg... | Python |
from fitch import fitch_tree
from graph.genetic_tree import specie, genetic_tree
alpabet = ['A','C','T','G']
class aml_tree(fitch_tree):
def __init__(self):
pass
def R(self, tr):
def helper(node):
if node.r:
node.R = {}
... | Python |
from genetic_tree import *
tr = genetic_tree()
v1 = specie(name = 'v1')
v2 = specie(name = 'v2')
v3 = specie(name = 'v3')
v4 = specie('A', name = 'v4')
v5 = specie('A', name = 'v5')
v6 = specie('A', name = 'v6')
v7 = specie('G', name = 'v7')
tr.add_edge(v1, v2)
tr.add_edge(v1, v3)
tr.add_edge(v2, v4)
tr.add_edge(v2,... | Python |
from graph.genetic_tree import genetic_tree
from graph.genetic_tree import specie
from graph.tree import tree
class fitch_tree(tree):
def __init__(self, tr):
self.gtr = tr
self.possible_r_trees = []
self.possible_trees = []
self.len = len(self.gtr.get_leaf().r)
self.score = 0
for i in range(self... | Python |
from fitch import *
if __name__ == '__main__':
print 'a)'
tr = genetic_tree()
v1 = specie(name = 'v1')
v2 = specie(name = 'v2')
v3 = specie(name = 'v3')
v4 = specie('AA', name = 'v4')
print 'v4: AA'
v5 = specie('AC', name = 'v5')
print 'v5: AC'
v6 = specie('CG', name ... | Python |
from graph.genetic_tree import genetic_tree as tree
from graph.genetic_tree import specie
is_leaf = tree.is_leaf
'''
Q4
'''
def are_isomorphic(tree1, tree2):
def dosomorphic(node1, node2):
# leaf(node1) XOR leaf(node2)
if is_leaf(node1) and not is_leaf(node2) or not is_leaf(node1) an... | Python |
#!/usr/bin/python2.5
from os import makedirs, chdir, environ
from os.path import join, expanduser
version = "<unknown>" # set during packaging
service = "fitness" # set during packaging
environ["FITNESS_VERSION"] = version
environ["FITNESS_SERVICE"] = service
home = expanduser(join("~", ".fitness"))
try:
makedi... | Python |
import gtk
import time
import datetime
try:
import hildon
except:
from hildonstub import hildon
class MyFloat(float):
def entry(self,dialog):
entry = gtk.Entry()
self.setentry(entry)
entry.connect("focus-in-event", self.focus_in_event)
return entry
def focus_in_event(sel... | Python |
# Hildon Stub
import pygtk
pygtk.require('2.0')
import gtk, pango
import time
import datetime
class Program(object):
def __init__(self):
pass
def add_window(self,window):
pass
def connect(self,event,cb):
pass
class HildonWidget(object):
def run(self):
p... | Python |
#!/usr/bin/env python2.5
# TODO dictonary of stored values should have a key based on description and
# unit. For this to work there should be an interactive recall of data from
# the dictonary which is based also on unit selected in dialog box
# there is no problem in upgrading existing CSV files becaus... | Python |
#!/usr/bin/env python2.5
# TODO dictonary of stored values should have a key based on description and
# unit. For this to work there should be an interactive recall of data from
# the dictonary which is based also on unit selected in dialog box
# there is no problem in upgrading existing CSV files becaus... | Python |
#!/usr/bin/python2.5
from os import makedirs, chdir, environ
from os.path import join, expanduser
version = "<unknown>" # set during packaging
service = "fitness" # set during packaging
environ["FITNESS_VERSION"] = version
environ["FITNESS_SERVICE"] = service
home = expanduser(join("~", ".fitness"))
try:
makedi... | Python |
#
# Create a debian package
#
from sys import argv
from os import mkdir, makedirs, chdir, chmod, getcwd, walk, remove, rmdir, \
environ, popen
from os.path import getmtime, getsize, join, basename, dirname
from base64 import b64encode
from StringIO import StringIO
name = "fitness"
serviceprefix = "com.googlecode.F... | Python |
#!/usr/bin/env python
#
# This is a quick hack to enable uploading and deleting files on your
# googlecode project. It borrows from googlecode_upload.py and from libgmail
# for details on how to upload files and obtain the SID cookie by signing in
# to google accounts.
# The script probes the Subversion configuration ... | Python |
#!/usr/bin/env python
#
# This is a quick hack to enable uploading and deleting files on your
# googlecode project. It borrows from googlecode_upload.py and from libgmail
# for details on how to upload files and obtain the SID cookie by signing in
# to google accounts.
# The script probes the Subversion configuration ... | Python |
class Context(object):
def __init__(self,name,version,flag):
self.name=name
self.version=version
self.flag=flag
class Autosave(object):
def __init__(self,context):
self.context=context
self.cb=None
def set_autosave_callback(self,cb,data=None):
... | Python |
import gtk
import csv
# the application main window launches lists which in tern launches
# dialogs which in turn are made from items
from items import *
from dialogs import *
class DateObjList(Dialog):
"""Managing objects that have a date field
"""
# When sublcassing, override the following:
title="D... | Python |
import gtk
import csv
try:
import hildon
except:
from hildonstub import hildon
# the application main window launches lists which in tern launches
# dialogs which in turn are made from items
from items import *
# All windows will have the same size
SZ=(600,400)
class Dialog(object):
""""Dialog box for ed... | Python |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from pygame.locals import *
from vec2d import vec2d
from enemy import Enemy
from enemy import BossBlackfiskEnemy
from enemy import BossTaggfiskEnemy
from player import PlayerShip
from shots import BaseShot
from powerup import Powerup
import random
imp... | Python |
########################################################################
import operator
import math
class vec2d(object):
"""2d vector class, supports vector and scalar operators,
and also provides a bunch of high level functions
"""
__slots__ = ['x', 'y']
def __init__(self, x_or... | Python |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from vec2d import vec2d
import os
class Creep(pygame.sprite.Sprite):
"""Representerar ett fiende-kryp."""
# Static
explosion_sound = None
def __init__(self, screen, img_filename, init_position,
init_dir... | Python |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from vec2d import vec2d
from shots import BaseShot
import os
class PlayerShip(pygame.sprite.Sprite):
"""Player ship."""
def __init__(self, screen):
"""Konstruktorn."""
pygame.sprite.Sprite.__init__(self)
self.... | Python |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
import random
from vec2d import vec2d
import os
#------------------------------------------------------------------------------
# BaseShot - Spelarens vanliga bubbelskott
#
#------------------------------------------------------------------------------... | Python |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from vec2d import vec2d
import random
from shots import BossShot
from shots import VektorShot
import os
#------------------------------------------------------------------------------------------------------
# Vanliga mobs.
#
#-----------------------... | Python |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from vec2d import vec2d
import os
'''
Created on 2 jun 2010
@author: Ingemar
'''
class Powerup(pygame.sprite.Sprite):
"""Representerar en powerup."""
def __init__(self, screen, init_position):
pygame.sprite.Sprite.__init__(se... | Python |
# -*- coding: utf-8 -*-
"""
Created---------------------------------------------------------------------------------------------
Importing things:-----------------------------------------------------------------------------------
---------------------------------------------------------------------------------------... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'karekodyeni.ui'
#
# Created: Thu Dec 5 12:52:36 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-06-04
@author: shell.xu
'''
import sys
import logging
import traceback
import random
import pyweb
def test_json(request, post):
if 'count' not in request.session: request.session['count'] = 0
else: request.session['count'] += 1
li = [request.session... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-09-29
@author: shell.xu
'''
import os
from distutils.core import setup
setup(name = 'pyweb', version = os.environ['VERSION'], url = 'http://shell909090.com/',
author = 'Shell.E.Xu', author_email = 'shell909090@gmail.com',
maintainer = 'Shell.E.Xu', ... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-06-04
@author: shell.xu
'''
import sys
import logging
import traceback
import pyweb
def test_google():
request = pyweb.HttpRequest.make_request('http://www.google.com/')
response = pyweb.http_client(request)
print response.get_body()
def test_self(... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-06-04
@author: shell.xu
'''
from __future__ import with_statement
import socket
import logging
import traceback
from contextlib import contextmanager
from urlparse import urlparse
import ebus
import esock
import daemon
import basehttp
import template
class Http... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-10-21
@author: shell.xu
@todo: 目前只实现了同余算法,没有实现一致性哈希算法。
'''
from __future__ import with_statement
import socket
import binascii
import esock
def k_node_mod(srvs, k):
''' 从服务器列表中,根据k,挑选一个合适的服务器
@param srvs: 服务器的list
@param k: 键值对象
@return: 获得一个服务器... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-06-04
@author: shell.xu
'''
import struct
import logging
import http
def nvpair_data(data, b):
if ord(data[b]) < 128: return b + 1, ord(data[b])
else: return b + 4, struct.unpack('<L', data[b : b + 4] & 0x7fffffff)[0]
def nvpair(data, b):
b, name_l... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-11-12
@author: shell.xu
'''
import sys
import time
import heapq
import logging
from greenlet import greenlet
from contextlib import contextmanager
try:
import epoll
epoll_factory = epoll.poll
timout_factor = 1000
python_epoll = True
except Impor... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-09-27
@author: shell.xu
'''
from __future__ import with_statement
import os
class TemplateCode(object):
def __init__(self): self.deep, self.rslt, self.defs = 0, [], []
def str(self, s):
if s: self.rslt.append(u'%swrite(u\'\'\'%s\'\'\')' % (u'\t... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-09-27
@author: shell.xu
'''
from __future__ import with_statement
import os
import stat
import urllib
import logging
from os import path
from datetime import datetime
import basehttp
import template
import apps
def get_stat_str(mode):
stat_list = []
if ... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-09-27
@author: shell.xu
'''
from __future__ import with_statement
import re
import time
import heapq
import urllib
import random
import cPickle
import logging
import traceback
import simplejson as json
import basehttp
import memcache
def J(request, func, *param... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-09-29
@author: shell.xu
'''
from apps import J, redirect, Dispatch, MemcacheCache, MemoryCache
from apps import MemcacheSession, MongoSession
from basehttp import *
from daemon import Daemon, set_weblog, set_log
from ebus import TimeOutException, bus, TokenPool
... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-06-04
@author: shell.xu
'''
import os
import errno
import socket
from greenlet import greenlet
from contextlib import contextmanager
import ebus
class SockBase(object):
buffer_size = 65536
def __init__(self, sock = None, socktype = socket.AF_INET, reus... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-10-24
@author: shell.xu
'''
from __future__ import with_statement
import os
import sys
import time
import fcntl
import signal
import logging
import datetime
from os import path
daemon = None
def handler(signum, frame):
global daemon
if signum == signal... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2010-06-04
@author: shell.xu
'''
import socket
import urllib
from datetime import datetime
from urlparse import urlparse
class HttpException(Exception): pass
class BadRequestError(HttpException):
def __init__(self, *params): HttpException.__init__(self, 400, *pa... | Python |
#!/usr/bin/python
import sys
import os
import os.path
import ConfigParser
import csv
import httplib
cwd = os.path.abspath((os.path.dirname(sys.argv[0])))
config_file = os.path.join(cwd, 'fetch_samples.conf')
#print 'config file: %s' % config_file
config = ConfigParser.RawConfigParser()
config.read(config_file)
samp... | Python |
#!/usr/bin/python
import sys
import os
import os.path
import ConfigParser
from xml.etree import ElementTree
cwd = os.path.abspath((os.path.dirname(sys.argv[0])))
config_file = os.path.join(cwd, 'analyze_samples.conf')
#print 'config file: %s' % config_file
config = ConfigParser.RawConfigParser()
config.read(config_f... | Python |
import pygame
from sys import exit
from pygame.locals import *
import os
import random
os.environ["SDL_VIDEO_CENTERED"] = "1"
pygame.init()
tela = pygame.display.set_mode((600, 480), 0, 32)
pygame.init()
pygame.display.set_caption("FittingBricks")
pygame.mouse.set_visible(False)
#funcao que faz os ma... | Python |
import pygame
pygame.init()
pygame.key.set_repeat(640,480)
import random
import os
def main():
txtcolor = (250,250,250)
tela = pygame.display.set_mode((640,480))
tela.fill((255,255,255))
erase = pygame.Rect(0,0,120,85)
mafont0 = pygame.font.SysFont('calibri',15) ; mafont1 = pyg... | Python |
import pygame
from sys import exit
from pygame.locals import *
import os
import random
os.environ["SDL_VIDEO_CENTERED"] = "1"
pygame.init()
tela = pygame.display.set_mode((640, 480), 0, 32)
pygame.init()
pygame.display.set_caption("FittingBricks")
pygame.mouse.set_visible(False)
#funcao que faz os ma... | Python |
import pygame
pygame.init()
pygame.key.set_repeat(640,480)
import random
import os
from sys import exit
#Codigo copiado e Editado
def main():
txtcolor = (250,250,250)
tela = pygame.display.set_mode((670,510))
tela.fill((255,255,255))
erase = pygame.Rect(0,0,120,85)
mafont0 = pyg... | Python |
import pygame,os
from pygame.locals import *
from sys import exit
pygame.init()
tela = pygame.display.set_mode((800,600))
tela.fill((255,255,255))
pygame.display.set_caption('FittingBricks')
icon = pygame.image.load("imagens" + os.sep + "icone.png").convert_alpha()
pygame.display.set_icon(icon)
pygame.mo... | 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 |
"""
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 |
# 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 |
# 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 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) 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 (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 |
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 |
# 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 |
#!/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 |
# 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 |
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.