def METHOD_NAME(instance, filename):
    if instance.is_public:
        upload_to = filer_settings.FILER_PUBLICMEDIA_UPLOAD_TO
    else:
        upload_to = filer_settings.FILER_PRIVATEMEDIA_UPLOAD_TO
    if callable(upload_to):
        return upload_to(instance, filename)
    else:
        return upload_to