def group_samaccountnames(self, base_dn):
        """For the current ADUser instance, determine which
        groups the user is a member of and convert the
        group DistinguishedNames to sAMAccountNames.
        The resulting list of groups may not be complete
        if explicit_membership_only was set to
        True when the object factory method (user() or users()) was
        called.

        :param str base_dn: The base DN to search within

        :return: A list of groups (sAMAccountNames) for which the
            current ADUser instance is a member, sAMAccountNames
        :rtype: list
        """
        #pylint: disable=no-member
        mappings = self.samaccountnames(base_dn, self.memberof)
        #pylint: enable=no-member
        groups = [samaccountname for samaccountname in mappings.values()]
        if not groups:
            logging.info("%s - unable to retrieve any groups for the current ADUser instance",
                         self.samaccountname)
        return groups
def group_samaccountnames ( self , base_dn ) : mappings = self . samaccountnames ( base_dn , self . memberof ) groups = [ samaccountname for samaccountname in mappings . values ( ) ] if not groups : logging . info ( "%s - unable to retrieve any groups for the current ADUser instance" , self . samaccountname ) return groups
For the current ADUser instance, determine which
        groups the user is a member of and convert the
        group DistinguishedNames to sAMAccountNames.
        The resulting list of groups may not be complete
        if explicit_membership_only was set to
        True when the object factory method (user() or users()) was
        called.

        :param str base_dn: The base DN to search within

        :return: A list of groups (sAMAccountNames) for which the
            current ADUser instance is a member, sAMAccountNames
        :rtype: list