code: def _configure_subnet(config):
      
  
      # Rationale: avoid subnet lookup if the network is already
      # completely manually configured
      if ("networkInterfaces" in config["head_node"]
              and "networkInterfaces" in config["worker_nodes"]):
          return config
  
      subnets = _list_subnets(config)
  
      if not subnets:
          raise NotImplementedError("Should be able to create subnet.")
  
      # TODO: make sure that we have usable subnet. Maybe call
      # compute.subnetworks().listUsable? For some reason it didn't
      # work out-of-the-box
      default_subnet = subnets[0]
  
      if "networkInterfaces" not in config["head_node"]:
          config["head_node"]["networkInterfaces"] = [{
              "subnetwork": default_subnet["selfLink"],
              "accessConfigs": [{
                  "name": "External NAT",
                  "type": "ONE_TO_ONE_NAT",
              }],
          }]
  
      if "networkInterfaces" not in config["worker_nodes"]:
          config["worker_nodes"]["networkInterfaces"] = [{
              "subnetwork": default_subnet["selfLink"],
              "accessConfigs": [{
                  "name": "External NAT",
                  "type": "ONE_TO_ONE_NAT",
              }],
          }]
  
      return config
docs: Pick a reasonable subnet if not specified by the config.