code: def cidr_func(
      req: AdvancedDataTypeRequest,
  ) -> AdvancedDataTypeResponse:
      """
      Convert a passed in AdvancedDataTypeRequest to a AdvancedDataTypeResponse
      """
      resp: AdvancedDataTypeResponse = {
          "values": [],
          "error_message": "",
          "display_value": "",
          "valid_filter_operators": [
              FilterStringOperators.EQUALS,
              FilterStringOperators.GREATER_THAN_OR_EQUAL,
              FilterStringOperators.GREATER_THAN,
              FilterStringOperators.IN,
              FilterStringOperators.LESS_THAN,
              FilterStringOperators.LESS_THAN_OR_EQUAL,
          ],
      }
      if req["values"] == [""]:
          resp["values"].append("")
          return resp
      for val in req["values"]:
          string_value = str(val)
          try:
              ip_range = (
                  ipaddress.ip_network(int(string_value), strict=False)
                  if string_value.isnumeric()
                  else ipaddress.ip_network(string_value, strict=False)
              )
              resp["values"].append(
                  {"start": int(ip_range[0]), "end": int(ip_range[-1])}
                  if ip_range[0] != ip_range[-1]
                  else int(ip_range[0])
              )
          except ValueError as ex:
              resp["error_message"] = str(ex)
              break
          else:
              resp["display_value"] = ", ".join(
                  map(
                      lambda x: f"{x['start']} - {x['end']}"
                      if isinstance(x, dict)
                      else str(x),
                      resp["values"],
                  )
              )
      return resp
  
imports: import ipaddress
  from typing import Any
  from sqlalchemy import Column
  from superset.advanced_data_type.types import AdvancedDataType, AdvancedDataTypeRequest, AdvancedDataTypeResponse
  from superset.utils.core import FilterOperator, FilterStringOperators
label_desc: Use image node_id 1 for calling a global function with example usage: cidr_func(req) and returns: resp, resp