code: def ipv4_to_str(ip):
      
      if isinstance(ip, numbers.Integral):
          return addrconv.ipv4.bin_to_text(struct.pack("!I", ip))
      else:
          return addrconv.ipv4.bin_to_text(ip)
docs: Converts binary or int type representation to human readable IPv4 string.
      :param ip: binary or int type representation of IPv4 address
      :return: IPv4 address string