def get(self, key, default=None):
        """
        Retrieve value associated with 'key' or return default value
        if 'key' doesn't exist.
        """
        try:
            return self[key]
        except KeyError:
            return default

        Retrieve value associated with 'key' or return default value
        if 'key' doesn't exist.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/util.py