def METHOD_NAME(cls, data, model=None, path=None, solver=None, **kwargs):
    if isinstance(data, (str, Path)):
        # argument is a filename
        path = data
        logger.info('Loading model from file: "{}"'.format(path))
        with open(path, "r") as f:
            data = f.read()
        return cls.loads(data, model, path, solver)
    if hasattr(data, "read"):
        logger.info("Loading model from file-like object.")
        # argument is a file-like object
        data = data.read()
        return cls.loads(data, model, path, solver)
    return cls._load_from_dict(data, model=model, path=path, solver=None, **kwargs)