def leader_filter(member: Member) -> bool:
            """Check whether provided *member* should replicate from the current node when it is running as a leader.

            :param member: a :class:`Member` object.

            :returns: ``True`` if provided member should replicate from the current node, ``False`` otherwise.
            """
            return member.replicatefrom is None or\
                member.replicatefrom == name or\
                not self.has_member(member.replicatefrom)
Check whether provided *member* should replicate from the current node when it is running as a leader.

            :param member: a :class:`Member` object.

            :returns: ``True`` if provided member should replicate from the current node, ``False`` otherwise.
            
patroni/dcs/__init__.py