code: def make_mreq(family, address):
      
      if not address:
          raise ValueError("Empty address")
  
      # Convert the address to a binary form
      group_bin = pton(family, address)
  
      if family == socket.AF_INET:
          # IPv4
          # struct ip_mreq
          # {
          #     struct in_addr imr_multiaddr; /* IP multicast address of group */
          #     struct in_addr imr_interface; /* local IP address of interface */
          # };
          # "=I" : Native order, standard size unsigned int
          return group_bin + struct.pack("=I", socket.INADDR_ANY)
  
      elif family == socket.AF_INET6:
          # IPv6
          # struct ipv6_mreq {
          #    struct in6_addr ipv6mr_multiaddr;
          #    unsigned int    ipv6mr_interface;
          # };
          # "@I" : Native order, native size unsigned int
          return group_bin + struct.pack("@I", 0)
  
      raise ValueError("Unknown family {0}".format(family))
docs: Makes a mreq structure object for the given address and socket family.
  
      :param family: A socket family (AF_INET or AF_INET6)
      :param address: A multicast address (group)
      :raise ValueError: Invalid family or address