

def current_placements(request):
    'Match current section to request path and get related placements.'
    current = None
    placements = Placement.objects.none()
    sections = retrieve_all_sections()
    for section in sections:
        pattern = re.compile(request.pattern)
        if pattern.search(request.path):
            current = section
            break
    if current:
        placements = retrieve_section_placements(current)
    return {
        SECTION_CONTEXT_KEY: current,
        PLACEMENTS_CONTEXT_KEY: placements,
    }

dataset/ETHPy150Open mlavin/django-ad-code/adcode/context_processors.py current_placements/VarMisuse@45/74 `section`->`request`