def _module_to_dict(module, omittable=(lambda k: k.startswith('_'))):
 return dict([(k, repr(v)) for (k, v) in module.__dict__.items() if (not omittable(k))])

def _module_to_dict ( module , omittable = ( lambda k : k . startswith ( '_' ) ) ) : return dict ( [ ( k , repr ( v ) ) for ( k , v ) in module . __dict__ . items ( ) if ( not omittable ( k ) ) ] )
converts a module namespace to a python dictionary .