human
Complete the below
@contextmanager
def patch_ldap(self, results):

    ''''defuse ldap functions to return fake entries instead of talking to a
    server. Use this in your own ldap related tests'
    '''

=====
What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    import ldap
    original_initialize = ldap.initialize
    def initialize(uri):
        return patch_ldap_connection(results)
    ldap.initialize = initialize
    (yield)
    ldap.initialize = original_initialize