code: def ensure_local_net(
          network_name: str = DOCKER_STARCRAFT_NETWORK,
          subnet_cidr: str = SUBNET_CIDR
  ) -> None:
      
      logger.info(f"checking whether docker has network {network_name}")
      ipam_pool = docker.types.IPAMPool(subnet=subnet_cidr)
      ipam_config = docker.types.IPAMConfig(pool_configs=[ipam_pool])
      networks = docker_client.networks.list(names=DOCKER_STARCRAFT_NETWORK)
      output = networks[0].short_id if networks else None
      if not output:
          logger.info("network not found, creating ...")
          output = docker_client.networks.create(DOCKER_STARCRAFT_NETWORK, ipam=ipam_config).short_id
      logger.debug(f"docker network id: {output}")
docs: Create docker local net if not found.
  
      :raises docker.errors.APIError