code: def resolve_input(self, ctx):
      field_name = ctx.params.get("field_name", None)
      new_field_name = ctx.params.get("new_field_name", None)
      inputs = types.Object()
      fields = ctx.dataset.get_field_schema(flat=True)
      field_keys = list(fields.keys())
      has_valid_field_name = field_name in field_keys
      field_selector = types.AutocompleteView()
      for key in field_keys:
          field_selector.add_choice(key, label=key)
  
      inputs.enum(
          "field_name",
          field_keys,
          label="Choose a field",
          description=(
              "The field to copy. You can use dot notation "
              "(embedded.field.name) to clone embedded fields"
          ),
          view=field_selector,
          required=True,
      )
      if has_valid_field_name:
          new_field_prop = inputs.str(
              "new_field_name",
              required=True,
              label="New field",
              description=(
                  "The new field to create. You can use dot notation "
                  "(embedded.field.name) to create embedded fields"
              ),
              default=f"{field_name}_copy",
          )
          if new_field_name and new_field_name in field_keys:
              new_field_prop.invalid = True
              new_field_prop.error_message = (
                  f"Field '{new_field_name}' already exists"
              )
              inputs.str(
                  "error",
                  label="Error",
                  view=types.Error(
                      label="Field already exists",
                      description=f"Field '{new_field_name}' already exists",
                  ),
              )
  
      return types.Property(
          inputs, view=types.View(label="Clone sample field")
      )
  
imports: import os
  import fiftyone
  import fiftyone.core.storage
  import fiftyone.operators
  import fiftyone.operators.types
label_desc: Use image node_id 2 for calling the CloneSampleField obj's underlying member method code with example usage: obj.resolve_input(ctx) and returns: types