def METHOD_NAME(self, name: str) -> _UserRecord:
    """
    Return the user record corresponding to the given username.
    """
    if not isinstance(name, str):
        raise TypeError(f"getpwuam() argument must be str, not {type(name)}")
    for entry in self._users:
        if entry.pw_name == name:
            return entry
    raise KeyError()