def METHOD_NAME(cls, notifications=None):
    """Get the context to render the notification template.
    AVAILABILITY notification are always aggregated by library and by
    patron. So we could use the first notification of the list to get
    global information about these data. We need to loop on each
    notification to get the documents information and pickup location
    informations related to each loan.
    """
    context = {}
    notifications = notifications or []
    if not notifications:
        return context
    patron = notifications[0].patron
    library = notifications[0].pickup_library
    include_address = notifications[0].get_communication_channel() == \
        NotificationChannel.MAIL
    # Dump basic informations
    context |= {
        'include_patron_address': include_address,
        'patron': patron.dumps(dumper=PatronNotificationDumper()),
        'library': library.dumps(
            dumper=LibraryCirculationNotificationDumper()),
        'loans': [],
        'delay': 0
    }
    # Availability notification could be sent with a delay. We need to find
    # this delay into the library notifications settings.
    for setting in library.get('notification_settings', []):
        if setting['type'] == NotificationType.AVAILABILITY:
            context['delay'] = setting.get('delay', 0)
    # Add metadata for any ``notification.loan`` of the notifications list
    item_dumper = ItemNotificationDumper()
    for notification in notifications:
        loc = lib = None
        keep_until = notification.loan.get('request_expire_date')
        if keep_until:
            keep_until = ciso8601.parse_datetime(keep_until)
        if notification.pickup_location:
            loc = notification.pickup_location
            lib = notification.pickup_library
        elif notification.transaction_location:
            loc = notification.transaction_location
            lib = notification.transaction_library
        # merge doc and item metadata preserving document key
        item_data = notification.item.dumps(dumper=item_dumper)
        doc_data = notification.document.dumps(
            dumper=document_title_dumper)
        doc_data = {**item_data, **doc_data}
        if loc and lib:
            context['loans'].append({
                'document': doc_data,
                'pickup_name': loc.get('pickup_name', lib.get('name')),
                'pickup_until': keep_until
            })
    return context