(case)
return []
Determine the location of the case's owner, and search up its
    ancestors to find the first OpenMRS Repeater(s).

    Returns a list because more than one OpenmrsRepeater may have the
    same location.
Determine the location of the case's owner, and search up its
    ancestors to find the first OpenMRS Repeater(s).
Determine the location of the case s owner and search up its ancestors to find the first OpenMRS Repeater ( s ) .
def get_case_location_ancestor_repeaters(case):
    """
    Determine the location of the case's owner, and search up its
    ancestors to find the first OpenMRS Repeater(s).

    Returns a list because more than one OpenmrsRepeater may have the
    same location.
    """
    from corehq.motech.openmrs.repeaters import OpenmrsRepeater

    case_location = get_case_location(case)
    if not case_location:
        return []
    location_repeaters = defaultdict(list)
    for repeater in OpenmrsRepeater.by_domain(case.domain):
        if repeater.location_id:
            location_repeaters[repeater.location_id].append(repeater)
    for location_id in reversed(case_location.path):
        if location_id in location_repeaters:
            return location_repeaters[location_id]
    return []
def get_case_location_ancestor_repeaters ( case ) : from corehq . motech . openmrs . repeaters import OpenmrsRepeater case_location = get_case_location ( case ) if not case_location : return [ ] location_repeaters = defaultdict ( list ) for repeater in OpenmrsRepeater . by_domain ( case . domain ) : if repeater . location_id : location_repeaters [ repeater . location_id ] . append ( repeater ) for location_id in reversed ( case_location . path ) : if location_id in location_repeaters : return location_repeaters [ location_id ] return [ ]