def _plot_option_logic(plot_options_from_call_signature):
 default_plot_options = copy.deepcopy(DEFAULT_PLOT_OPTIONS)
 file_options = tools.get_config_file()
 session_options = session.get_session_plot_options()
 plot_options_from_call_signature = copy.deepcopy(plot_options_from_call_signature)
 for option_set in [plot_options_from_call_signature, session_options, file_options]:
  utils.validate_world_readable_and_sharing_settings(option_set)
  utils.set_sharing_and_world_readable(option_set)
  if (('filename' in option_set) and ('fileopt' not in option_set)):
   option_set['fileopt'] = 'overwrite'
 user_plot_options = {}
 user_plot_options.update(default_plot_options)
 user_plot_options.update(file_options)
 user_plot_options.update(session_options)
 user_plot_options.update(plot_options_from_call_signature)
 user_plot_options = {k: v for (k, v) in user_plot_options.items() if (k in default_plot_options)}
 return user_plot_options

def _plot_option_logic ( plot_options_from_call_signature ) : default_plot_options = copy . deepcopy ( DEFAULT_PLOT_OPTIONS ) file_options = tools . get_config_file ( ) session_options = session . get_session_plot_options ( ) plot_options_from_call_signature = copy . deepcopy ( plot_options_from_call_signature ) for option_set in [ plot_options_from_call_signature , session_options , file_options ] : utils . validate_world_readable_and_sharing_settings ( option_set ) utils . set_sharing_and_world_readable ( option_set ) if ( ( 'filename' in option_set ) and ( 'fileopt' not in option_set ) ) : option_set [ 'fileopt' ] = 'overwrite' user_plot_options = { } user_plot_options . update ( default_plot_options ) user_plot_options . update ( file_options ) user_plot_options . update ( session_options ) user_plot_options . update ( plot_options_from_call_signature ) user_plot_options = { k : v for ( k , v ) in user_plot_options . items ( ) if ( k in default_plot_options ) } return user_plot_options
given some plot_options as part of a plot call .