def METHOD_NAME(self):
    server = urlparse(self.uri)
    netloc = server.netloc.split(":")
    # define the server and the connection
    s = ldap3.Server(netloc[0], port=int(netloc[1]), use_ssl=server.scheme == 'ldaps',
                     get_info=ldap3.ALL, tls=self.tls)
    auth = ldap3.SIMPLE
    if self.bindUser is None and self.bindPw is None:
        auth = ldap3.ANONYMOUS
    c = ldap3.Connection(s, auto_bind=True, client_strategy=ldap3.SYNC,
                         user=self.bindUser, password=self.bindPw,
                         authentication=auth)
    return c