def METHOD_NAME(cmd, workspace_name, spark_pool_name, from_index=None, size=None):
    client = cf_synapse_spark_session(cmd.cli_ctx, workspace_name, spark_pool_name)
    return client.get_spark_sessions(from_index, size, detailed=True)