def get_manager(self, user):
        """

        :param user: sAMAccountName of the user
        :return: sAMAccountName of the manager or None
        """
        filter = "(&%s(sAMAccountName=%s))" % (self.filter, user)
        ret = self.search_ext_s(filter, ["manager"])
        if ret and ret[0] and 'manager' in ret[0]['attributes'] and ret[0]['attributes']['manager']:
            ret = ret[0]['attributes']['manager'][0]
            if ret:
                return self.get_username(dn=ret)
def get_manager ( self , user ) : filter = "(&%s(sAMAccountName=%s))" % ( self . filter , user ) ret = self . search_ext_s ( filter , [ "manager" ] ) if ret and ret [ 0 ] and 'manager' in ret [ 0 ] [ 'attributes' ] and ret [ 0 ] [ 'attributes' ] [ 'manager' ] : ret = ret [ 0 ] [ 'attributes' ] [ 'manager' ] [ 0 ] if ret : return self . get_username ( dn = ret )
:param user: sAMAccountName of the user
        :return: sAMAccountName of the manager or None