def ipv4_to_str(ip):
 if isinstance(ip, int):
  return addrconv.ipv4.bin_to_text(struct.pack('!I', ip))
 else:
  return addrconv.ipv4.bin_to_text(ip)

def ipv4_to_str ( ip ) : if isinstance ( ip , int ) : return addrconv . ipv4 . bin_to_text ( struct . pack ( '!I' , ip ) ) else : return addrconv . ipv4 . bin_to_text ( ip )
converts binary or int type representation to human readable ipv4 string .