code: def register_sensor(self, name, sensor=None):
      if sensor is None:
          sensor = {}
      # Unfortunately, Kubernetes client does not handle optimistic
      # concurrency control by itself unlike kubectl
      client = self._client.get()
      if not sensor:
          sensor["metadata"] = {}
  
      try:
          sensor["metadata"][
              "resourceVersion"
          ] = client.CustomObjectsApi().get_namespaced_custom_object(
              group=self._group,
              version=self._version,
              namespace=self._namespace,
              plural="sensors",
              name=name,
          )[
              "metadata"
          ][
              "resourceVersion"
          ]
      except client.rest.ApiException as e:
          # Sensor does not exist and we want to add one
          if e.status == 404:
              try:
                  return client.CustomObjectsApi().create_namespaced_custom_object(
                      group=self._group,
                      version=self._version,
                      namespace=self._namespace,
                      plural="sensors",
                      body=sensor,
                  )
              except client.rest.ApiException as e:
                  raise ArgoClientException(
                      json.loads(e.body)["message"]
                      if e.body is not None
                      else e.reason
                  )
          else:
              raise ArgoClientException(
                  json.loads(e.body)["message"]
                  if e.body is not None
                  else e.reason
              )
      try:
          return client.CustomObjectsApi().replace_namespaced_custom_object(
              group=self._group,
              version=self._version,
              namespace=self._namespace,
              plural="sensors",
              body=sensor,
              name=name,
          )
      except client.rest.ApiException as e:
          raise ArgoClientException(
              json.loads(e.body)["message"]
              if e.body is not None
              else e.reason
          )
  
imports: import json
  import os
  import sys
  from metaflow.exception import MetaflowException
  from metaflow.plugins.kubernetes.kubernetes_client import KubernetesClient
label_desc: Use image node_id 14 for calling the ArgoClient obj's underlying member method code with example usage: obj.register_sensor(name, sensor) and returns: client, client