| Home | Trees | Indices | Help |
|
|---|
|
|
Utils module for StarCluster
|
|||
|
AttributeDict Subclass of dict that allows read-only attribute-like access to dictionary key/values |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
__package__ =
|
|||
|
|||
Decorator for printing execution time (in mins) of a function
Optionally takes a user-friendly msg as argument. This msg will
appear in the sentence "[msg] took XXX mins". If no msg is specified,
msg will default to the decorated function's name. e.g:
@print_timing
def myfunc():
print 'Running myfunc'
>>> myfunc()
Running myfunc
myfunc took 0.000 mins
@print_timing('My function')
def myfunc():
print 'Running myfunc'
>>> myfunc()
Running myfunc
My function took 0.000 mins
|
Check if bucket_name is a valid S3 bucket name (as defined by the AWS docs): 1. 3 <= len(bucket_name) <= 255 2. all chars one of: a-z 0-9 . _ - 3. first char one of: a-z 0-9 4. name must not be a valid ip |
Check if image_name is a valid AWS image name (as defined by the AWS docs) 1. 3<= len(image_name) <=128 2. all chars one of: a-z A-Z 0-9 ( ) . - / _ |
Returns command to execute python script as a one-line python program
e.g.
import os
script = '''
import os
print os.path.exists('hi')
'''
os.system(make_one_liner(script))
Will print out:
<module 'os' from ...>
False
|
Returns generator of all permutations of a
The following code is an in-place permutation of a given list, implemented
as a generator. Since it only returns references to the list, the list
should not be modified outside the generator. The solution is
non-recursive, so uses low memory. Work well also with multiple copies of
elements in the input list.
Retrieved from:
http://stackoverflow.com/questions/104420/ how-to-generate-all-permutations-of-a-list-in-python
|
Checks that all commands in the programs list exist. Returns True if all commands exist and raises exception.CommandNotFound if not. |
Returns the path to the program provided it exists and is on the system's PATH retrieved from code snippet by Jay: http://stackoverflow.com/questions/377017/ test-if-executable-exists-in-python |
Convenience wrapper around inspect.getargspec Returns a tuple whose first element is a list containing the names of all required arguments and whose second element is a list containing the names of all keyword (optional) arguments. |
iterate through 'chunks' of a list. final chunk consists of remaining elements if items does not divide len(ls) evenly. items - size of 'chunks' |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 17 13:43:24 2011 | http://epydoc.sourceforge.net |