This function is supposed to inspect a model and extract its metadata if possible, or accept a weights_obj and so on. However, currently it does nothing with the model parameter, making itself quite misleading. Perhaps it can be modified as:
def get_model_classes_from_weights_meta(model=None, weights_obj=None):
"""
Docs...
"""
if weights_obj is None and model is not None:
weights_obj = getattr(model, "_weights", None)
# ...