def extract_msg_options(options, keep=MSG_OPTIONS):
 return dict(((name, options.get(name)) for name in keep))

def extract_msg_options ( options , keep = MSG_OPTIONS ) : return dict ( ( ( name , options . get ( name ) ) for name in keep ) )
extracts known options to basic_publish from a dict .