def METHOD_NAME(data, warning):
    """Get relation partition label of data object."""
    label = None
    for relation in data.relations:
        if relation.category == "Replicate":
            label = next(
                p.label for p in relation.partitions if p.entity_id == data.entity_id
            )
        else:
            other_relation = next(
                p for p in relation.partitions if p.entity_id == data.entity_id
            )
            if other_relation:
                warning(
                    f"Sample {data.entity.name} has defined {relation.category} "
                    "relation. Samples will only be merged based on Replicate relations."
                )
    return label