code: def make_cidr(gw, mask):
      
      try:
          int_mask = (0xFFFFFFFF << (32 - int(mask))) & 0xFFFFFFFF
          gw_addr_int = struct.unpack('>L', socket.inet_aton(gw))[0] & int_mask
          return (socket.inet_ntoa(struct.pack("!I", gw_addr_int)) +
                  '/' + str(mask))
      except (socket.error, struct.error, ValueError, TypeError):
          return
docs: Create network address in CIDR format.
  
      Return network address for a given gateway address and netmask.