docstr: This function is going to find all the running vSphere VMs created by Ray via
  the tag filters, the VMs should either be powered_on or be powered_off but has
  a tag "vsphere-node-status:creating"
docstr_tok: ["This","function","is","going","to","find","all","the","running","vSphere","VMs","created","by","Ray","via","the","tag","filters",",","the","VMs","should","either","be","powered_on","or","be","powered_off","but","has","a","tag","``","vsphere-node-status",":","creating","''"]
code: def non_terminated_nodes(self, cluster_name, tag_filters):
      """
      This function is going to find all the running vSphere VMs created by Ray via
      the tag filters, the VMs should either be powered_on or be powered_off but has
      a tag "vsphere-node-status:creating"
      """
      with self.lock:
          nodes = []
          vms = self.vsphere_sdk_client.vcenter.VM.list()
          filters = tag_filters.copy()
          tag_cache = {}
          if TAG_RAY_CLUSTER_NAME not in tag_filters:
              filters[TAG_RAY_CLUSTER_NAME] = cluster_name
          for vm in vms:
              vm_id = vm.vm
              dynamic_id = DynamicID(
                  type=Constants.TYPE_OF_RESOURCE, id=vm_id
              )
  
              matched_tags, all_tags = self.get_matched_tags(
                  filters, dynamic_id
              )
              # Update the tag cache with latest tags
              tag_cache[vm_id] = all_tags
  
              if len(matched_tags) == len(filters):
                  # All the tags in the filters are matched on this vm
                  power_status = (
                      self.vsphere_sdk_client.vcenter.vm.Power.get(
                          vm_id
                      )
                  )
  
                  # Return VMs in powered-on and creating state
                  vsphere_node_status = all_tags.get(
                      Constants.VSPHERE_NODE_STATUS
                  )
                  if is_powered_on_or_creating(
                      power_status, vsphere_node_status
                  ):
                      nodes.append(vm_id)
  
          logger.debug(f"Non terminated nodes are {nodes}")
          return nodes, tag_cache
  
imports: import logging
  import time
  import uuid
  from threading import RLock
  import com.vmware.vapi.std.errors_client
  import requests
  from com.vmware.cis.tagging_client import CategoryModel
  from com.vmware.content.library_client import Item
  from com.vmware.vapi.std.errors_client import Unauthenticated
  from com.vmware.vapi.std_client import DynamicID
  from com.vmware.vcenter.ovf_client import DiskProvisioningType, LibraryItem
  from com.vmware.vcenter.vm.hardware_client import Cpu, Memory
  from com.vmware.vcenter.vm_client import Power
  from com.vmware.vcenter_client import VM, Host, ResourcePool
  from vmware.vapi.vsphere.client import create_vsphere_client
  from ray.autoscaler._private.vsphere.utils import Constants, singleton_client
  from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME
label_desc: Use image node_id 9 for calling the VsphereSdkProvider obj's underlying member method code with example usage: obj.non_terminated_nodes(cluster_name, tag_filters) and returns: nodes,  tag_cache