<s> import os <EOL> import json <EOL> import random <EOL> def fixture_path ( name ) : <EOL> here = os . path . dirname ( __file__ ) <EOL> return os . path . join ( here , '<STR_LIT:..>' , '<STR_LIT>' , name ) <EOL> class Job ( object ) : <EOL> def __init__ ( self , name , * args , ** kwargs ) : <EOL> self . name = '<STR_LIT>' % ( name , random . random ( ) ) <EOL> self . options = kwargs <EOL> def profile_stats ( self ) : <EOL> raise NotImplemented <EOL> def wait ( self ) : <EOL> pass <EOL> class Disco ( object ) : <EOL> def __init__ ( self , server = None ) : <EOL> self . server = server <EOL> self . master = server <EOL> def new_job ( self , * args , ** kwargs ) : <EOL> return Job ( * args , ** kwargs ) <EOL> def purge ( self , job_name ) : <EOL> pass <EOL> class DDFS ( object ) : <EOL> def __init__ ( self , server = None ) : <EOL> self . server = server <EOL> with open ( fixture_path ( '<STR_LIT>' ) ) as f : <EOL> self . ddfs = json . loads ( f . read ( ) ) <EOL> for tag , blobs in self . ddfs . iteritems ( ) : <EOL> self . ddfs [ tag ] = [ tuple ( x ) for x in blobs ] <EOL> def list ( self , tag ) : <EOL> return [ key for key in self . ddfs . iterkeys ( ) if key . startswith ( tag ) ] <EOL> def blobs ( self , tag ) : <EOL> return self . ddfs . get ( tag , [ ] ) <EOL> def tag ( self , tag , target ) : <EOL> self . ddfs . setdefault ( tag , [ ] ) . extend ( target ) </s>
