def hostname(ip, reverse=False):
    try:
        result = socket.gethostbyaddr(str(ip))
        return result[0] if not reverse else result[2][0]
    except socket.error:
        return None
hostname(ip) -> 'hostname'
dataset/ETHPy150Open allegro/ralph/src/ralph/lib/network/__init__.py/hostname