def __init__(self, filename=None):
        self.filename = None
        if filename:
            self.load(filename)
def _find_user(self, dn):
        return next(i for (i, d) in enumerate(self.directory) if d["dn"] == dn)