def getpwnam(self, name):
        """
        Return the user record corresponding to the given username.
        """
        for entry in self._users:
            if entry.pw_name == name:
                return entry
        raise KeyError()

        Return the user record corresponding to the given username.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/fakepwd.py