code: def ProfilerDataclassField(description: str, default: Dict = {}):
      """Returns custom dataclass field for `ludwig.modules.profiler.ProfilerConfig`. Allows `None` by default.
  
      :param description: Description of the torch profiler field
      :param default: dict that specifies clipping param values that will be loaded by its schema class (default: {}).
      """
      allow_none = True
  
      class ProfilingMarshmallowField(fields.Field):
          """Custom marshmallow field class for the torch profiler.
  
          Deserializes a dict to a valid instance of `ludwig.modules.optimization_modules.ProfilerConfig` and
          creates a corresponding JSON schema for external usage.
          """
  
          def _deserialize(self, value, attr, data, **kwargs):
              if value is None:
                  return value
              if isinstance(value, dict):
                  try:
                      return ProfilerConfig.Schema().load(value)
                  except (TypeError, ValidationError):
                      raise ValidationError(
                          f"Invalid params for profiling config: {value}, see ProfilerConfig class."
                      )
              raise ValidationError("Field should be None or dict")
  
          def _jsonschema_type_mapping(self):
              return {
                  **schema_utils.unload_jsonschema_from_marshmallow_class(
                      ProfilerConfig
                  ),
                  "title": "profiler_options",
                  "description": description,
              }
  
      if not isinstance(default, dict):
          raise ValidationError(f"Invalid default: `{default}`")
  
      def load_default():
          return ProfilerConfig.Schema().load(default)
  
      dump_default = ProfilerConfig.Schema().dump(default)
  
      return field(
          metadata={
              "marshmallow_field": ProfilingMarshmallowField(
                  allow_none=allow_none,
                  load_default=load_default,
                  dump_default=dump_default,
                  metadata={
                      "description": description,
                      "parameter_metadata": None,
                  },
              )
          },
          default_factory=load_default,
      )
  
file_path: ludwig/ludwig/schema/profiler.py
imports: from dataclasses import field
  from typing import Dict
  from marshmallow import fields, ValidationError
  import ludwig.schema.utils
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.schema.utils import ludwig_dataclass
label_desc: Use image node_id 1 for calling a global function with example usage: ProfilerDataclassField(description, default) and returns: field, ProfilerConfig, dict, value, ProfilerConfig