<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_authentication_from_public_key_id(self, key_id):
 """Return the authentication based on it's id."""

        for authentication in self._authentications:
            if authentication.is_key_id(key_id):
                return authentication
        return None