Python: How to set the Anim Class on a SkeletalMeshComponent?

I want to set the “Anim Class” on a skeletal mesh component via python. In the Editor gui it’s simple enough to select from the “Anim Class” drop-down menu. Then when selecting the AnimBluePrint in the Content Browser it selects the AnimBlueprint I generated (also via python). However, when attempting to “set_anim_class” on the SkeletalMeshComponent to the blueprint asset I get an error that I cannot nativize AnimBlueprint. When I had set this in the UI I see that the Anim Class is set to an AnimBlueprintGeneratedClass object. How do I derive such an object from my AnimBlueprint object?

The same problem.

anim_class = unreal.EditorAssetLibrary.load_blueprint_class('/Game/APS/Data/Animations/APS_animbp.APS_animbp')

component.set_anim_class(anim_class)

Not working. No log errors.

component.set_editor_property('anim_class', anim_class)

Not work too.
How to assign AnimBP to skeletal mesh?

Try this:

anim_class = unreal.EditorAssetLibrary.load_asset('/Game/APS/Data/Animations/APS_animbp.APS_animbp')
component.set_anim_class(anim_class.generated_class())