def get_path_el(c_type, context, use_labels=False):
    """Get the path element for container"""
    if c_type == 'group':
        return context.get('_id')
    if use_labels:
        fields = ['label']
    else:
        fields = ['_id', 'label']
    for field in fields:
        value = context.get(field)
        if not value:
            continue
        if field == '_id':
            return f'<id:{value}>'
        if field == 'label':
            return value
    raise TypeError(f'Cannot get {c_type} path element from context {context}')
