import struct
import socket


def long_to_ipv4(ip_long):
    """Convert a long representation to a human readable IPv4 string

    >>> long_to_ipv4(2130706433L)
    '127.0.0.1'
    >>> long_to_ipv4(16909060L)
    '1.2.3.4'
    """
    ip_bytes = struct.pack("!I", ip_long)
    return socket.inet_ntop(socket.AF_INET, ip_bytes)