def METHOD_NAME(cls, ds_type, name, size):
    if not ds_type or ds_type == DatasetType.TEXT:
        return TextDatasetMetric(name, size)
    else:
        logger.warning("Not support dataset type %s", ds_type)