Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Group and partition

This script enables the group_by functionality like the similar function existing in Ruby on Rails. ...
Python

Grouping objects into disjoint sets

This class provides a lightweight way to group arbitrary objects together into disjoint sets when a full-blown graph data structure would be overkill. Objects can be joined using .join(), tested for connectedness using joined(), and all disjoint sets can be retreived using get(). The objects being joined must be hashable. ...
Python

High performance currying with instance method

This script implements the instance method for performing currying. Instance method provides a way to perform currying such that the curried function runs much faster than one produced by closure. Currying is an important technique to build callables on the fly and is well covered in other recipes. If the callables ...
Python

How to disable debug logging in release version

When you release your program to client, its a good idea to disable all the debug messages. It is possible via custom configuring debug levels at all modules, but may be implemented using a simple wrapper around logging.getnted usinfunction. ...
Python

How to Set Environment Variables

This script writes the environment variables using a batch file wrapper. It overcomes an operating system limitation. ...
Python

Implementation of sets using sorted lists

This script implements set operations using sorted lists as the underlying data structure. Advantages: - Space savings -- lists are much more compact than a dictionary based implementation. - Flexibility -- elements do not need to be hashable, only __cmp__ is required. - Fast operations depending on the ...
Python

Implementing Future s with decorators

This script shows you how to kick off a slow process without waiting around for the result. The process is run in the background until the value is actually needed at which time it blocks until the value is ready. ...
Python

Improved Gray Scale Quantization

Improved Gray Scale (IGS) codes are used for the elimination of false contouring in images, and image compression. This Python program generates the IGS codes for a set of input gray level values. ...
Python

Infix Postfix

This script is useful to convert an infix expression to postfix and vice-versa. You can also evaluate infix and postfix expressions. ...
Python

Integrating Twisted reactor with IPython

This script allows you to run the Twisted reactor event loop in a thread alongside an IPython shell, for introspecting a running Twisted process. ...
Python

Interfaces

Interfaces script deals with the Interface concept in Python. ...
Python

IPv4 address set type

IPv4 address set type script initializes an ip4range class.The constructor accepts an unlimited number of arguments that may either be tuples in the form (start,stop), integers, longs or strings, where start and stop in a tuple may also be of the form integer, long or string. Passing an integer or long ...
Python

Just in time instantiation

JIT is a class for Just In Time instantiation of objects. Init is called only when the first attribute is either get or set. Then automatic delegation is used to front for the object. ...
Python

kexec the newest linux kernel

Kexec is a mechanism to use linux itself to load a new kernel without going through the BIOS thus minimizing down time. This script kexecs the newest kernel on the system managed by rpm (assumes a Redhat like system). ...
Python

Large File Sizes on 32 bit Windows

You can't use the os library to determine the size of large files on 32 bit Windows. This script uses the FindFiles win32call which provides among other things file size information. ...
Python

Lazy attributes

Lazy attributes script shows how to create attributes with 'computed at first use' values. ...
Python

Lazy streams using generators

This class allows you to use generators as more list-like streams. The chief advantage is that it is impossible to iterate through a generator more than once, while a stream can be re-used like a list. ...
Python

Lazy Traversal of Directed Graphs

The os.path.walk routine that ships with the python standard library is limited to traversing the file system tree. This script allows you to realize a generic traversal for arbitrary (directed) graphs with support for recursion limits. ...
Python

Length limited O 1 LRU Cache implementation

Length-limited O(1) LRU Cache implementation script is an implementation of a length-limited O(1ion scripue. ...
Python

List and dictionary observer

This script implements an observer pattern for dictionaries and lists. It does not support a one-many relation. The observer is sent enough information so that the change can be undone. ...
Python