code: async def create(
              cls, start_ip: str, end_ip: str, *,
              type: IPRangeType = IPRangeType.RESERVED,
              comment: str = None, subnet: Union[Subnet, int] = None):
          
          if not isinstance(type, IPRangeType):
              raise TypeError(
                  "type must be an IPRangeType, not %s"
                  % TYPE(type).__name__)
  
          params = {
              'start_ip': start_ip,
              'end_ip': end_ip,
              'type': type.value,
          }
          if comment is not None:
              params["comment"] = comment
          if subnet is not None:
              if isinstance(subnet, Subnet):
                  params["subnet"] = subnet.id
              elif isinstance(subnet, int):
                  params["subnet"] = subnet
              else:
                  raise TypeError(
                      "subnet must be Subnet or int, not %s" % (
                          TYPE(subnet).__class__))
          return cls._object(await cls._handler.create(**params))
docs: Create a `IPRange` in MAAS.
  
          :param start_ip: First IP address in the range (required).
          :type start_ip: `str`
          :parma end_ip: Last IP address in the range (required).
          :type end_ip: `str`
          :param type: Type of IP address range (optional).
          :type type: `IPRangeType`
          :param comment: Reason for the IP address range (optional).
          :type comment: `str`
          :param subnet: Subnet the IP address range should be created on
              (optional). By default MAAS will calculate the correct subnet
              based on the `start_ip` and `end_ip`.
          :type subnet: `Subnet` or `int`
          :returns: The created IPRange
          :rtype: `IPRange`