old_contents: import yaml
  import logging
  
  class Shortcuts():
  
    def __init__(self, filename):
      logging.warning("Loading shortcuts file '%s'" % filename)
      with open(filename) as stream:
        shortcuts = yaml.load(stream)
      self.shortcuts = {shorturl.lower(): url for shorturl, url in shortcuts.items()}
  
    def lookup_shorturl(self, shorturl):
      return self.shortcuts.get(shorturl.lower(), self.shortcuts['default'])
  
new_contents: import yaml
  import logging
  
  class Shortcuts():
  
    def __init__(self, filename):
      logging.warning("Loading shortcuts file '%s'" % filename)
      with open(filename) as stream:
        shortcuts = yaml.load(stream, Loader=yaml.SafeLoader)
      self.shortcuts = {shorturl.lower(): url for shorturl, url in shortcuts.items()}
  
    def lookup_shorturl(self, shorturl):
      return self.shortcuts.get(shorturl.lower(), self.shortcuts['default'])
  
subject: load YAML safely to avoid startup warning