code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/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 |
# 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 |
#!/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 |
"""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 |
"""
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 |
#!/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/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 |
if not 'submit' in POST:
print """
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="testPYTHON.py">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br/>
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br/>
Gender:<br/>
M... | Python |
if not 'submit' in POST:
print """
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="testPYTHON.py">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br/>
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br/>
Gender:<br/>
M... | Python |
if not 'submit' in POST:
print """
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="testPYTHON.py">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br/>
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br/>
Gender:<br/>
M... | Python |
if not 'submit' in POST:
print """
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="testPYTHON.py">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br/>
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br/>
Gender:<br/>
M... | Python |
if not 'submit' in POST:
print """
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="testPYTHON.py">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br/>
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br/>
Gender:<br/>
M... | Python |
#!/usr/bin/env python
# webkit2png - makes screenshots of webpages
# http://www.paulhammond.org/webkit2png
__version__ = "0.5"
# Copyright (c) 2009 Paul Hammond
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to ... | Python |
#!/usr/bin/env python
# webkit2png - makes screenshots of webpages
# http://www.paulhammond.org/webkit2png
__version__ = "0.5"
# Copyright (c) 2009 Paul Hammond
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to ... | Python |
import shutil
import os
import os.path
def run(cmd):
print("\nRunning command: " + cmd)
assert os.system(cmd) == 0, "\nCommand failed: " + cmd
def go(work_dir):
os.chdir(work_dir)
assert os.path.exists('maven')
print("Copying maven-metdata.xml files...")
shutil.copy('maven/repo... | Python |
#This script is not really portable. It's just to automate some manual steps I usually do when releasing.
#It might evolve into someting more robust but for now it's ok for me.
import os
import shutil
def run(cmd):
print("\nRunning command: " + cmd)
if os.system(cmd) == 0: print("\nWarning, command failed... | Python |
#This script is not really portable. It's just to automate some manual steps I usually do when releasing.
#It might evolve into someting more robust but for now it's ok for me.
import os
def run(cmd):
print("\nRunning command: " + cmd)
assert os.system(cmd) == 0, "\nCommand failed: " + cmd
ant_cmd = 'an... | 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 implementat... | Python |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | Python |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | Python |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | Python |
"""Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | Python |
"""Implementation of JSONDecoder
"""
import re
import sys
import struct
from simplejson.scanner import make_scanner
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconst... | Python |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | Python |
r"""Using simplejson from the shell to validate and
pretty-print::
$ echo '{"json":"obj"}' | python -msimplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -msimplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
import simplejson
def main():
import sys
if l... | Python |
"""JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | Python |
#!/usr/bin/python2.4
'''Load the latest update for a Twitter user and leave it in an XHTML fragment'''
__author__ = 'dewitt@google.com'
import codecs
import getopt
import sys
import twitter
TEMPLATE = """
<div class="twitter">
<span class="twitter-user"><a href="http://twitter.com/%s">Twitter</a>: </span>
<span... | Python |
#!/usr/bin/python2.4
'''Post a message to twitter'''
__author__ = 'dewitt@google.com'
import ConfigParser
import getopt
import os
import sys
import twitter
USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Options:
-h --help : print this help
--consumer-key : the twit... | Python |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | Python |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-#
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | Python |
#!/usr/bin/env python
from Tkinter import *
from datetime import *
import os
import time
import sys
import pyglet
import smbus
class Wecker():
ringOn = datetime.now() + timedelta(0, 60)
def __init__(self):
self.timeString = self.ringOn.time().__str__()[0:5]
def increaseValue(self):
print... | Python |
#!/usr/bin/env python
from Tkinter import *
from datetime import *
import os
import time
import sys
import pyglet
import smbus
class Wecker():
ringOn = datetime.now() + timedelta(0, 60)
def __init__(self):
self.timeString = self.ringOn.time().__str__()[0:5]
def increaseValue(self):
print... | Python |
#!/usr/bin/python3
# coding=UTF-8
# Author: Franz Platzer
# Teammembers:Georg Schlagholz, Franz Platzer, Michael Mayer
import os
class ServerInfo:
def getInfos(self):
"""returns hostname and temperature in celsius of the computer as a tuple"""
p = '/sys/class/thermal/thermal_zone0/temp'
if not o... | Python |
#!/usr/bin/python3
# coding=UTF-8
# Author: Georg Schlagholz
# Teammembers:Georg Schlagholz, Franz Platzer, Michael Mayer
import ServerInfo
import http.server
import ssl
import socketserver
import socket
import sys
#This class will handle any incoming request from
#the browser
# openssl req -new -x509 -newkey rsa:20... | Python |
#!/usr/bin/python3
# coding=UTF-8
# Author: Michael Mayer
# Teammembers:Georg Schlagholz, Franz Platzer, Michael Mayer
import os, sys, signal
import urllib.request
def call_server(server):
""" server: a URL to the server IP:Port
returns one entry: a tuple: hostname (string) and temperature in celsius (stri... | Python |
#!/usr/bin/python3
# coding=UTF-8
# Author: Georg Schlagholz
# Teammembers:Georg Schlagholz, Franz Platzer, Michael Mayer
import ServerInfo
import http.server
import ssl
import socketserver
import socket
import sys
#This class will handle any incoming request from
#the browser
# openssl req -new -x509 -newkey rsa:20... | Python |
#!/usr/bin/python3
# coding=UTF-8
# Author: Franz Platzer
# Teammembers:Georg Schlagholz, Franz Platzer, Michael Mayer
import os
class ServerInfo:
def getInfos(self):
"""returns hostname and temperature in celsius of the computer as a tuple"""
p = '/sys/class/thermal/thermal_zone0/temp'
if not o... | Python |
#!/usr/bin/python3
# coding=UTF-8
# Author: Michael Mayer
# Teammembers:Georg Schlagholz, Franz Platzer, Michael Mayer
import os, sys, signal
import urllib.request
def call_server(server):
""" server: a URL to the server IP:Port
returns one entry: a tuple: hostname (string) and temperature in celsius (stri... | Python |
import math
class Visualizer:
def renderLine(self, v1, v2): pass
def renderSphere(self, pos, r): pass
def invertSphere(self, v):
return (v / (4.0 / 3.0 * math.pi)) ** (1.0/3.0)
def renderWorld(self, world):
for body in world.bodies:
for spring in body.springs:... | Python |
from vec3 import Vec3
from pointMass import PointMass
from spring import Spring
from solidMass import SolidMass
class Sheet(SolidMass):
def __init__(self, mass = 1, stiffness = 1, rows = 3, cols = 3, pos = Vec3(), width = 10, height = 10):
SolidMass.__init__(self)
points = []
... | Python |
import math
class Quat:
def __init__(self, w = 1, x = 0, y = 0, z = 0):
self.w = w
self.x = x
self.y = y
self.z = z
def __repr__(self):
axis, angle = self.toAxisAngle()
return "<Quat %.3f %s>" % (angle, axis)
@staticmethod
def fromAxisAngl... | Python |
from pointMass import PointMass
from vec3 import Vec3
class Spring:
def __init__(self, fromPoint, toPoint, length = None, stiffness = 1, friction = 0.25):
self.fromPoint = fromPoint
self.toPoint = toPoint
self.length = length or (fromPoint.pos - toPoint.pos).length()
self.st... | Python |
from solidMass import SolidMass
from pointMass import PointMass
from spring import Spring
from vec3 import Vec3
import math
class Sphere(SolidMass):
def __init__(self, r = 1, pos = Vec3(), mass = 1, stiffness = 1, slices = 5, stacks = 5):
SolidMass.__init__(self)
stacks -= 2
s... | Python |
import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from visualizer import Visualizer
from world import World
from vec3 import Vec3
from sphere import Sphere
from sheet import Sheet
from rigidJoint import RigidJoint
import time
import math
import random
class ... | Python |
from vec3 import Vec3
class PointMass:
def __init__(self, pos = Vec3(), mass = 1):
self.lastPos = self.pos = pos
self.vel = Vec3()
self.force = Vec3()
self.mass = mass
def applyForce(self, f):
self.force += f
def tick(self, dt):
acc = self.forc... | Python |
import math
class Matrix:
"""4x4 row major matrix"""
def __init__(self):
self.v = [[0 for i in range(4)] for j in range(4)]
self.v[0][0] = self.v[1][1] = self.v[2][2] = self.v[3][3] = 1
def __repr__(self):
return "<Matrix %s>" % str(self.v)
def __mul__(self, m... | Python |
from solidMass import SolidMass
class Joint(SolidMass):
def __init__(self, fromMass, toMass):
SolidMass.__init__(self)
self.fromMass = fromMass
self.toMass = toMass
| Python |
from joint import Joint
from vec3 import Vec3
from quat import Quat
from matrix import Matrix
from spring import Spring
from pointMass import PointMass
import math
class RigidJoint(Joint):
def __init__(self, fromMass, toMass, slices = 4, stiffness = 1):
Joint.__init__(self, fromMass, toMass)
... | Python |
import math
class Vec3:
def __init__(self, x = 0, y = 0, z = 0):
self.x = x
self.y = y
self.z = z
def __repr__(self):
return "<Vec3 %.3f %.3f %.3f>" % (self.x,self.y,self.z)
def __add__(self, v):
assert isinstance(v,Vec3)
return Vec3(self.x + v... | Python |
from vec3 import Vec3
class World:
def __init__(self):
self.bodies = []
self.visualizers = []
self.gravity = Vec3(0,-1,0)
self.groundHeight = 0
self.groundFriction = 1
def tick(self, dt):
for body in self.bodies:
for pm in body.pointMas... | Python |
from vec3 import Vec3
from pointMass import PointMass
from spring import Spring
class SolidMass:
def __init__(self):
self.clear()
def clear(self):
self.pointMasses = []
self.springs = []
def getBoundingRadius(self):
assert self.pointMasses
center = se... | 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 |
# 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 |
# 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 |
#!/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 |
"""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 |
"""
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 |
#!/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 |
from tkinter import *
from groupList import GroupList
from login import Login
class Gui_Login:
def __init__(self, root, gui):
self.gui = gui
self.root = root
self.root.geometry("450x200")
self.root.resizable(0,0)
self.login = Login(self.root, self.gui)
... | Python |
import xml.etree.ElementTree as ET
from message import Message
import datetime
class Messenger:
messageId = []
# Konstruktor
def __init__(self, user_id):
self.id = user_id;
self.file = ET.parse("messages.xml")
self.root = self.file.getroot()
messages = self.root.getchildren(... | Python |
from tkinter import *
from groupList import GroupList
class Gui_Grouplist:
def __init__(self, root, gui, grouplist):
self.gui = gui
self.root = root
self.grouplist = grouplist
self.root.geometry("870x600")
self.root.resizable(0,0)
... | Python |
class Message:
# Konstruktor
def __init__(self, id, subject, content, sender, recipient, date, status_sender, status_recipient):
self.id = id
self.subject = subject
self.content = content
self.sender = sender
self.recipient = recipient
self.date = date
... | Python |
from user import User
import re
class Registration():
userMinLength = 6
passwdMinLength = 6
def __init__(self, root, gui):
self.root = root
self.gui = gui
def checkContent(self, gui_Registration, name, username, lastname, plz, passwd, passwdconfirm, address, phone, e... | Python |
from tkinter import *
class Gui_Team:
def __init__(self, root, gui, group, team):
self.gui = gui
self.root = root
self.team = team
self.group = group
self.root.geometry("870x650")
self.main_frame=Frame(self.root, height=600, width=850, bg="#f0f... | Python |
import xml.etree.ElementTree as ET
import datetime
from wall_message import WallMessage
class Wall:
def __init__(self, groupid, typ):
self.groupid = groupid
self.typ = typ
def createWall(self):
self.messageList = []
self.file = ET.parse("walls.xml")
self.root ... | Python |
from tkinter import *
class Gui_Topframe:
def __init__(self, root, gui):
self.gui = gui
self.root = root
def create_messenger():
self.gui.createMessenger()
def change_profile():
self.gui.createChangeProfile... | Python |
from team import Team
class TeamList:
def __init__(self, groupid):
self.teamList = []
self.groupid= groupid
def addXmlTeams(self, teams):
for xml_team in teams:
id = xml_team.getAttribute("Tid")
name = xml_team.getElementsByTagName("team_name")[0].first... | Python |
from wall import Wall
from memberList import MemberList
from teamList import TeamList
class Group:
typ = "group"
def __init__(self, groupid, name):
self.groupid = groupid
self.name = name
def addXmlWall(self):
self.wall = Wall(self.groupid, self.typ)
self.wall.... | Python |
from tkinter import *
from registration import Registration
class Gui_Registration:
def __init__(self, root, gui):
self.gui = gui
self.root = root
self.root.geometry("650x300")
self.root.resizable(0,0)
self.registration = Registration(sel... | Python |
from xml.dom import minidom
from group import Group
class GroupList:
groupList = []
def __init__(self):
xmldoc = minidom.parse("groups.xml")
groups = xmldoc.getElementsByTagName("group")
for group in groups:
groupid = group.getAttribute("id")
nam... | 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.