def ip_v4(self, with_port: bool = False) -> str:
        """Generate a random IPv4 address.

        :param with_port: Add port to IP.
        :return: Random IPv4 address.

        :Example:
            19.121.223.58
        """
        ip = '.'.join(str(self.random.randint(0, 255)) for _ in range(4))

        if with_port:
            ip += ':{}'.format(self.port())

        return ip
def ip_v4 ( self , with_port : bool = False ) -> str : ip = '.' . join ( str ( self . random . randint ( 0 , 255 ) ) for _ in range ( 4 ) ) if with_port : ip += ':{}' . format ( self . port ( ) ) return ip
Generate a random IPv4 address.

        :param with_port: Add port to IP.
        :return: Random IPv4 address.

        :Example:
            19.121.223.58