This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Analyse(obj): | |
""" Dynamic Dispatch based on object's class type. | |
This will call the AnalyseClassName | |
Example: if obj is of type Let, then call AnalyseLet, | |
if it is of type IfElse call AnalyseIfElse | |
""" | |
# Get obj's class name | |
class_name = obj.__class__.__name__ | |
# Create the function name as a string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Implementation of a simple directed graph with no weights. | |
Test by either running python on this file, | |
or by calling nosetests on this file. | |
""" | |
import unittest | |
import collections | |
class DirectedGraph: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" A script to plot data using matplotlib. | |
Usage: [prog] [options] file1 file2 .. | |
The files passed are assumed to contain two values (x, y) per line. | |
There are two ways of using this script -- from the shell, or by calling the | |
Plot function with the appropriate arguments. |