import socket
import struct


def int2ip(ip):
	"""Convert an IP in an 32bit int to a string in dot-decimal notation.
	:param ip: int
	"""
	if not isinstance(ip, int):
			raise ValueError("ip must be int and is {0} instead".format(type(ip)))
	return socket.inet_ntoa(struct.pack('!I', ip))