def get_field_kwargs(field):
    """Constructs the field keyword arguments dictionary for the given field.

    Args:
        field: a :class:`fiftyone.core.fields.Field` or ``str(field)``
            representation of one

    Returns:
        a field specification dict
    """
    if etau.is_str(field):
        return _parse_field_str(field)

    fields = []

    kwargs = {
        "ftype": type(field),
        "fields": fields,
        "db_field": field.db_field,
        "description": field.description,
        "info": field.info,
        "read_only": field.read_only,
        "created_at": field.created_at,
    }

    if isinstance(field, (fof.ListField, fof.DictField)):
        field = field.field
        if field is not None:
            kwargs["subfield"] = type(field)

    if isinstance(field, fof.EmbeddedDocumentField):
        kwargs["embedded_doc_type"] = field.document_type
        for f in field.get_field_schema().values():
            if not f.name.startswith("_"):
                _kwargs = get_field_kwargs(f)
                _kwargs["name"] = f.name
                fields.append(_kwargs)

    return kwargs
Constructs the field keyword arguments dictionary for the given field.

    Args:
        field: a :class:`fiftyone.core.fields.Field` or ``str(field)``
            representation of one

    Returns:
        a field specification dict
    
fiftyone/core/odm/utils.py