def get_entity_repr(serialization_context, serializer_cls, entity):
    """
    Retrieves the dictionary representation of an entity.
    :param serialization_context: The context used for serialization. This
    is useful because it contains the request context, which in turns contain
    the user who made the request, if any.
    :param serializer_cls: The class for serializing the related entity.
    :param entity: The entity to make a representation for.
    :return:
    """
    if entity is None:
        return entity
    return serializer_cls(
        entity, context=serialization_context).to_representation(entity)