code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
import pygame
import os
import Player
import Fantasma
import Jogo
import NomeUser
import Nivel
import Funcoes
import Menu
import Loop
import EscolhePlayer
import Opcoes
import Instrucoes
import Creditos
fps = pygame.time.Clock()
pygame.init()
pygame.mixer.init()
modoTela = 0
background = pygame.di... | Python |
import pygame, os
from pygame.locals import *
import Objetos
class Opcoes:
def setVolume(this, volNum):
Objetos.sndMorte.set_volume(volNum/100.0)
Objetos.sndMoeda.set_volume(volNum/100.0)
for i in range(7):
Objetos.musicas[i].set_volume(volNum/100.0)
... | Python |
import pygame
import os
import Objetos
class Sonic:
def __init__ (this):
this.direcao = "direita"
this.x = 0
this.y = 0
this.velX = 2
this.velY = 0
this.velocidade = 2
this.proxLinha = 0
... | Python |
import pygame, os
from pygame.locals import *
import Objetos
class EscolhePlayer:
def __init__(this):
this.player = ""
def selectPlayer(this):
while True:
mouse_pos = pygame.mouse.get_pos()
mouse_press = pygame.mouse.get_pressed()
... | Python |
import pygame
from pygame.locals import *
import Objetos
def verificaTeclas():
pressed = pygame.key.get_pressed()
##--- CHECA SAIDA
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
if event.type == KEYDOWN:
if event.key == K_... | Python |
import pygame
from pygame.locals import *
import Objetos
class Creditos:
def run(this):
while True:
mouse_pos = pygame.mouse.get_pos()
mouse_press = pygame.mouse.get_pressed()
for event in pygame.event.get():
if event.type =... | Python |
import pygame
from pygame.locals import *
import Objetos
class Instrucoes:
def __init__(this):
this.cont = 0
this.animaRoda = 0
this.animaTurbo = 0
def run(this):
while True:
mouse_pos = pygame.mouse.get_pos()
mouse_... | Python |
import pygame
import Objetos
class Nivel:
def __init__ (this):
this.qtdTilesX = 0
this.qtdTilesY = 0
this.mapa = {}
this.acumulo = 0
this.animaTurbo = 0
this.animaRoda = 0
##--- DEFINE O TILE NA POSICAO EM QUESTAO
def Set... | Python |
import pygame
import Objetos
class Jogo:
def __init__ (this):
this.nivel = 1
this.score = 0
this.vidas = 3
this.modo = 0
this.tempoModo = 0
this.setModo(4)
this.qtdTilesTela = (21, 19)
this.tamanhoTela = (... | Python |
import Objetos
Objetos.menu.run()
| Python |
import pygame
from pygame.locals import *
import os
import Objetos
class NomeUser:
def __init__(this):
this.user = ""
this.image = pygame.image
def clearUser(this):
this.user = ""
##--- GRAVA O NOME E A PONTUACAO NO ARQUIVO
def gravarScore(this):
dad... | Python |
import pygame
from pygame.locals import *
import random
import Objetos
import Funcoes
class Principal:
def playMusicas(this):
this.i = random.randint(1,6)
Objetos.musicas[this.i].play(-1)
def stopMusicas(this):
for i in range(1,7):
Objetos.musicas[i].... | Python |
import pygame
import os
import random
import Objetos
class Fantasma:
def __init__ (this):
this.x = 0
this.y = 0
this.velX = 0
this.velY = 0
this.velocidade = 1
this.proxLinha = 0
this.proxColuna = 0
... | Python |
import pygame
from pygame.locals import *
import os
import Objetos
import random
class Menu:
def __init__(self):
Objetos.musicas[0].play(-1)
pygame.init()
self.image_grande = pygame.image
self.image_medio = pygame.image
self.image_pequeno = pygame.image
... | Python |
#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
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITH... | Python |
import os
import re
import random
import hashlib
import hmac
from string import letters
import webapp2
import jinja2
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir),
... | Python |
VERSION='0.0.1'
import sys
APPNAME='p2t'
srcdir = '.'
blddir = 'build'
p2t_source_files = ['poly2tri/common/shapes.cc',
'poly2tri/sweep/cdt.cc',
'poly2tri/sweep/advancing_front.cc',
'poly2tri/sweep/sweep_context.cc',
'poly2tri/sw... | Python |
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | Python |
#! /usr/bin/python
import glob
import shutil
import sys
import subprocess
import os
if 'linux' in sys.platform:
platform = 'linux'
else:
platform = 'darwin'
toolchain = "%s/android-toolchain" % os.getenv("HOME")
openssl_version = "1.0.0k"
encfs_version = "1.7.4"
def cpfile(src, target):
sys.stdout.write... | Python |
#! /usr/bin/python
import glob
import shutil
import sys
import subprocess
import os
def cpfile(src, target):
sys.stdout.write("Copying %s to %s\n" % (src, target))
shutil.copy(src, target)
# We only copy the armeabi version of the binary
archs = ["armeabi"]
for arch in archs:
try:
os.makedirs(".... | Python |
#! /usr/bin/python
import glob
import shutil
import sys
import subprocess
import os
def cpfile(src, target):
sys.stdout.write("Copying %s to %s\n" % (src, target))
shutil.copy(src, target)
# We only copy the armeabi version of the binary
archs = ["armeabi"]
for arch in archs:
try:
os.makedirs(".... | Python |
# -*- coding:utf-8 -*-
import csv
import scipy.interpolate as sp
import numpy
#try:
#import pylab
#except:
#print "Erro ao importar a MatPlotLib"
#print "Consute http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.2.0/"
class water(object):
""" Class doc """
#Temperatura
Temperature=numpy.... | Python |
# -*- coding:utf-8 -*-
import csv
import scipy.interpolate as sp
import numpy
import janela
import wx
import wx.lib.dialogs
class waterNext(object):
""" Class doc """
#Temperatura
Temperature=numpy.array([0])
#Pressão
Press=numpy.array([0])
#Volume
Volume=numpy.array([0])
#Energia
Energy=numpy.array([0])
#E... | Python |
#!/usr/bin/python
# -*- coding:utf-8 -*-
from pontos import *
import janela
import os # para ter acesso aos parâmetros
try:
import numpy
except:
print "Erro ao importar a NumPy"
print "Consute http://sourceforge.net/projects/numpy/files/NumPy/1.7.0/ "
try:
import scipy.interpolate as sp
except:
print ... | Python |
#!/usr/bin/python
# -*- coding:utf-8 -*-
'''locais'''
from pontos import *
import janela
'''externos'''
try:
import numpy
except:
print "Erro ao importar a NumPy"
print "Consute http://sourceforge.net/projects/numpy/files/NumPy/1.7.0/ "
try:
import scipy.interpolate as sp
except:
print "Erro ao importar a SciPy"... | Python |
# -*- coding:utf-8 -*-
import wx
import wx.lib.dialogs
########################################################################
class text(wx.Frame):
#----------------------------------------------------------------------
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Impressão de valores")
pa... | Python |
#!/usr/bin/python
# -*- coding:utf-8 -*-
'''locais'''
from pontos import *
import janela
'''externos'''
try:
import numpy
except:
print "Erro ao importar a NumPy"
print "Consute http://sourceforge.net/projects/numpy/files/NumPy/1.7.0/ "
try:
import scipy.interpolate as sp
except:
print "Erro ao importar a SciPy"... | Python |
#!/usr/bin/python
# -*- coding:utf-8 -*-
from pontos import *
import janela
import os # para ter acesso aos parâmetros
try:
import numpy
except:
print "Erro ao importar a NumPy"
print "Consute http://sourceforge.net/projects/numpy/files/NumPy/1.7.0/ "
try:
import scipy.interpolate as sp
except:
print ... | Python |
#!/usr/bin/env python
#coding=utf-8
from distutils.core import setup
import py2exe
includes = ["encodings", "encodings.*"]
options = {"py2exe":
{
"compressed": 1,
"optimize": 2,
#"includes": includes,
"bundle_files": 1
}
... | Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.1 or later
Recommended: Python 2.3 or later
Recommended: CJKCodecs... | Python |
from utils.datatypes import CaselessDict
from utils.http import headers_dict_to_raw
class Headers(CaselessDict):
"""Case insensitive http headers dictionary"""
__slots__ = ['encoding']
def __init__(self, seq=None, encoding='utf-8'):
self.encoding = encoding
super(Headers, self).__init__(... | Python |
import codecs
_ENCODING_ALIASES = dict({})
_ENCODING_ALIASES.update([])
def encoding_exists(encoding, _aliases=_ENCODING_ALIASES):
"""Returns ``True`` if encoding is valid, otherwise returns ``False``"""
try:
codecs.lookup(resolve_encoding(encoding, _aliases))
except LookupError:
return Fa... | Python |
"""Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | Python |
import warnings
from functools import wraps
def deprecated(use_instead=None):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used."""
def wrapped(func):
@wraps(func)
def new_func(*args, **kwargs)... | Python |
def headers_raw_to_dict(headers_raw):
"""
Convert raw headers (single multi-line string)
to the dictionary.
For example:
>>> headers_raw_to_dict("Content-type: text/html\\n\\rAccept: gzip\\n\\n")
{'Content-type': ['text/html'], 'Accept': ['gzip']}
Incorrect input:
>>> headers_raw_to_d... | Python |
"""
This module contains essential stuff that should've come with Python itself ;)
It also contains functions (or functionality) which is in Python versions
higher than 2.5 which is the lowest version supported by Scrapy.
"""
import re
import inspect
import weakref
from functools import wraps
from sgmllib import SGML... | Python |
"""
Functions for dealing with markup text
"""
import re
from htmlentitydefs import name2codepoint
from utils.python import str_to_unicode
_ent_re = re.compile(r'&(#?(x?))([^&;\s]+);')
_tag_re = re.compile(r'<[a-zA-Z\/!].*?>', re.DOTALL)
def remove_entities(text, keep=(), remove_illegal=True, encoding='utf-8'):
... | Python |
"""
This module contains data types used by Scrapy which are not included in the
Python Standard Library.
This module must not depend on any module outside the Standard Library.
"""
import copy
from collections import deque, defaultdict
from itertools import chain
class MultiValueDictKeyError(KeyError):
pass
cl... | Python |
"""
This module provides functions for generating libxml2 documents (xmlDoc).
Constructors must receive a Response object and return a xmlDoc object.
"""
import libxml2
xml_parser_options = libxml2.XML_PARSE_RECOVER + \
libxml2.XML_PARSE_NOERROR + \
libxml2.XML_PARSE_NOWARNI... | Python |
"""
XPath selectors
See documentation in docs/topics/selectors.rst
"""
import libxml2
from utils.response.text import TextResponse
from utils.python import flatten, unicode_to_str
from utils.misc import extract_regex
from utils.trackref import object_ref
from utils.decorator import deprecated
from .factories import... | Python |
"""
This module contains a simple class (Libxml2Document) which provides cache and
garbage collection to libxml2 documents (xmlDoc).
"""
import weakref
from utils.trackref import object_ref
from .factories import xmlDoc_from_html
class Libxml2Document(object_ref):
cache = weakref.WeakKeyDictionary()
__slots... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
import sys, glob
sys.path.insert(0, '..')
from chardet.universaldetector import UniversalDetector
count = 0
u = UniversalDetector()
for f in glob.glob(sys.argv[1]):
print f.ljust(60),
u.reset()
for line in file(f, 'rb'):
u.feed(line)
if u.done: break
u.close()
result = u.result
... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All ... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | Python |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | Python |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | Python |
"""Helper functions which doesn't fit anywhere else"""
import re
import hashlib
from utils.python import flatten
from utils.markup import remove_entities
def arg_to_iter(arg):
"""Convert an argument to an iterable. The argument can be a None, single
value, or an iterable.
Exception: if arg is a dict, [a... | Python |
# -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Text::Unidecode's xAB.pm lists. This combines all xAB.pm files into
a single dictionary.
'''
CODEPOINTS = {
u'x20': [
'', ''... | Python |
# -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Decode unicode text to an ASCII representation of the text. Transliterate
unicode characters to ASCII.
Based on the ruby unidecode gem (http://rubyforge.org/projects/un... | Python |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | Python |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | Python |
'''
Make strings safe for use as ASCII filenames, while trying to preserve as much
meaning as possible.
'''
import re
import os
from math import ceil
from utils.unidecode.unidecoder import Unidecoder
udc = Unidecoder()
def ascii_text(orig):
try:
ascii = udc.decode(orig)
except:
if isinstance(... | Python |
"""This module provides some functions and classes to record and report
references to live object instances.
If you want live objects for a particular class to be tracked, you only have to
subclass form object_ref (instead of object). Also, remember to turn on
tracking by enabling the TRACK_REFS setting.
About perfor... | Python |
"""
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
import re
import codecs
from utils.BeautifulSoup import UnicodeDammit
from utils.response import Response
from utils.p... | Python |
"""
This module implements the HtmlResponse class which adds encoding
discovering through HTML encoding declarations to the TextResponse class.
See documentation in docs/topics/request-response.rst
"""
import re
from utils.response.text import TextResponse
from utils.python import memoizemethod_noargs
class HtmlRes... | Python |
"""
This module implements the XmlResponse class which adds encoding
discovering through XML encoding declarations to the TextResponse class.
See documentation in docs/topics/request-response.rst
"""
import re
from utils.response.text import TextResponse
from utils.python import memoizemethod_noargs
class XmlRespon... | Python |
"""
This module implements the Response class which is used to represent HTTP
responses in Scrapy.
See documentation in docs/topics/request-response.rst
"""
import copy
from utils.headers import Headers
from utils.trackref import object_ref
class Response(object_ref):
__slots__ = ['_url', 'headers', 'status', ... | Python |
#!/usr/bin/env python
#coding=utf-8
import hashlib
import os
import time,datetime
import re
import urllib
import string
import uuid
import socket
import urllib2
import logging
from utils import feedparser
from utils import template
from utils import escape
from utils.BeautifulSoup import BeautifulSoup
from utils.sele... | Python |
#!/usr/bin/env python
from config import *
import cgi, sys, os, urlparse, sys, re
import cgitb
cgitb.enable()
if PYDIR not in sys.path:
sys.path.insert(0, PYDIR)
if WEBDIR not in sys.path:
sys.path.insert(0, WEBDIR)
if SRCDIR not in sys.path:
sys.path.insert(0, SRCDIR)
import feedvalidator
from feedvali... | Python |
"""$Id: compatibility.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__li... | Python |
"""$Id: root.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__license__ =... | Python |
"""$Id: item.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__license__ =... | Python |
"""$Id: rdf.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__license__ = ... | Python |
"""$Id: iso639codes.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__lice... | Python |
"""$Id: logging.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__license_... | Python |
"""$Id: rss.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__license__ = ... | Python |
"""$Id: textInput.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__licens... | Python |
"""$Id: link.py 4 2004-02-03 17:31:11Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 4 $"
__date__ = "$Date: 2004-02-03 17:31:11 +0000 (Tue, 03 Feb 2004) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
__license__ =... | 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.