annotate data_generation/transformations/pycaptcha/Captcha/__init__.py @ 625:128bc92897f2

Script to generate resized version of mnist in two different ways: rescaling and zeropadding
author Salah Rifai <salahmeister@gmail.com>
date Wed, 16 Mar 2011 00:05:39 -0400
parents 1f5937e9e530
children
rev   line source
87
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
1 """ Captcha
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
2
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
3 This is the PyCAPTCHA package, a collection of Python modules
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
4 implementing CAPTCHAs: automated tests that humans should pass,
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
5 but current computer programs can't. These tests are often
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
6 used for security.
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
7
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
8 See http://www.captcha.net for more information and examples.
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
9
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
10 This project was started because the CIA project, written in
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
11 Python, needed a CAPTCHA to automate its user creation process
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
12 safely. All existing implementations the author could find were
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
13 written in Java or for the .NET framework, so a simple Python
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
14 alternative was needed.
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
15 """
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
16 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
17 # PyCAPTCHA Package
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
18 # Copyright (C) 2004 Micah Dowty <micah@navi.cx>
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
19 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
20
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
21 __version__ = "0.3-pre"
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
22
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
23
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
24 # Check the python version here before we proceed further
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
25 requiredPythonVersion = (2,2,1)
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
26 def checkVersion():
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
27 import sys, string
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
28 if sys.version_info < requiredPythonVersion:
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
29 raise Exception("%s requires at least Python %s, found %s instead." % (
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
30 name,
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
31 string.join(map(str, requiredPythonVersion), "."),
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
32 string.join(map(str, sys.version_info), ".")))
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
33 checkVersion()
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
34
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
35
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
36 # Convenience imports
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
37 from Base import *
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
38 import File
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
39 import Words
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
40
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
41 ### The End ###