def METHOD_NAME(cls, v, values):
    if v is None:
        filename = values.get("filename")
        if filename:
            mime_content_type, _ = guess_type(filename, strict=False)
            return mime_content_type
    return v