def METHOD_NAME(address_format_type: str, address_data_dict: dict, address_key_prefix: str):
    result = ''
    if address_format_type == AddressFormatType.FOREIGN:
        addr_line_1_key = f'{address_key_prefix}addr_line_1'
        result = address_data_dict[addr_line_1_key]
    elif address_format_type in (AddressFormatType.BASIC, AddressFormatType.ADVANCED):
        unit_type_key = f'{address_key_prefix}unit_type'
        unit_no_key = f'{address_key_prefix}unit_no'
        civic_no_key = f'{address_key_prefix}civic_no'
        civic_no_suffix_key = f'{address_key_prefix}civic_no_suffix'
        street_name_key = f'{address_key_prefix}street_name'
        street_type_key = f'{address_key_prefix}street_type'
        street_direction_key = f'{address_key_prefix}street_direction'
        street_address_elements = [address_data_dict[unit_type_key],
                                   address_data_dict[unit_no_key],
                                   address_data_dict[civic_no_key],
                                   address_data_dict[civic_no_suffix_key],
                                   address_data_dict[street_name_key],
                                   address_data_dict[street_type_key],
                                   address_data_dict[street_direction_key]]
        for element in street_address_elements:
            if element:
                result += f' {element}'
    result = result.strip()
    return result