def __init__(self, adaptee, **adapted_methods):
        """
        Initialize a new adapter instance.

        @param adaptee: The object to adapt to a new interface.
        @type adaptee: Object
        @param adapted_methods: A dictionary of methods to adapt.
        @type adapted_methods: dict
        """
        self.__adaptee = adaptee
        self.__dict__.update({k: v for k, v in adapted_methods.items() if callable(v) and
                              getattr(self.__adaptee, v.__name__, None)})

        Initialize a new adapter instance.

        @param adaptee: The object to adapt to a new interface.
        @type adaptee: Object
        @param adapted_methods: A dictionary of methods to adapt.
        @type adapted_methods: dict
        
pypattyrn/structural/adapter.py