parameters: (location, session)
return_statement: return settings
docstring: Returns the terminal settings associated with the given *location* that are
      stored in the user's session directory.
docstring_summary: Returns the terminal settings associated with the given *location* that are
      stored in the user's session directory.
docstring_tokens: Returns the terminal settings associated with the given * location * that are stored in the user s session directory .
function: def restore_term_settings(location, session):
      """
      Returns the terminal settings associated with the given *location* that are
      stored in the user's session directory.
      """
      if not session:
          return # Just a viewer of a broadcast terminal
      session_dir = options.session_dir
      session_dir = os.path.join(session_dir, session)
      settings_path = os.path.join(session_dir, 'term_settings.json')
      if not os.path.exists(settings_path):
          return # Nothing to do
      with io.open(settings_path, encoding='utf-8') as f:
          try:
              settings = json_decode(f.read())
          except ValueError:
              # Something wrong with the file.  Remove it
              term_log.error(_(
                  "Error decoding {0}.  File will be removed.").format(
                      settings_path))
              os.remove(settings_path)
              return {}
      return settings
function_tokens: def restore_term_settings ( location , session ) : if not session : return # Just a viewer of a broadcast terminal session_dir = options . session_dir session_dir = os . path . join ( session_dir , session ) settings_path = os . path . join ( session_dir , 'term_settings.json' ) if not os . path . exists ( settings_path ) : return # Nothing to do with io . open ( settings_path , encoding = 'utf-8' ) as f : try : settings = json_decode ( f . read ( ) ) except ValueError : # Something wrong with the file.  Remove it term_log . error ( _ ( "Error decoding {0}.  File will be removed." ) . format ( settings_path ) ) os . remove ( settings_path ) return { } return settings