code: def _validate_record_fields(dataset: Dataset, fields: Dict[str, Any]):
      fields_copy = copy.copy(fields or {})
      for field in dataset.fields:
          if field.required and not (
              field.name in fields_copy
              and fields_copy.get(field.name) is not None
          ):
              raise ValueError(
                  f"missing required value for field: {field.name!r}"
              )
  
          value = fields_copy.pop(field.name, None)
          if value and not isinstance(value, str):
              raise ValueError(
                  f"wrong value found for field {field.name!r}. Expected {str.__name__!r}, found {type(value).__name__!r}"
              )
  
      if fields_copy:
          raise ValueError(
              f"found fields values for non configured fields: {list(fields_copy.keys())!r}"
          )
  
imports: import copy
  from datetime import datetime
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Literal, Optional, Sequence, Set, Tuple, TypeVar, Union
  from uuid import UUID
  import sqlalchemy
  from fastapi.encoders import jsonable_encoder
  from sqlalchemy import Select, and_, func, select
  from sqlalchemy.orm import contains_eager, joinedload, selectinload
  import argilla.server.errors.future
  from argilla.server.contexts import accounts
  from argilla.server.enums import DatasetStatus, RecordInclude, UserRole
  from argilla.server.models import Dataset, Field, MetadataProperty, Question, Record, Response, ResponseStatus, Suggestion, Vector, VectorSettings
  from argilla.server.models.suggestions import SuggestionCreateWithRecordId
  from argilla.server.schemas.v1.datasets import DatasetCreate, FieldCreate, MetadataPropertyCreate, QuestionCreate, RecordCreate, RecordIncludeParam, RecordsCreate, RecordUpdateWithId, ResponseValueCreate
  from argilla.server.schemas.v1.datasets import VectorSettings
  from argilla.server.schemas.v1.metadata_properties import MetadataPropertyUpdate
  from argilla.server.schemas.v1.records import ResponseCreate
  from argilla.server.schemas.v1.responses import ResponseUpdate, ResponseUpsert, ResponseValueUpdate
  from argilla.server.schemas.v1.vectors import Vector
  from argilla.server.search_engine import SearchEngine
  from argilla.server.security.model import User
label_desc: Use image node_id 3 for calling a global function with example usage: _validate_record_fields(dataset, fields) without return types