def METHOD_NAME(details, p, office):
    match = address_re.search(details)
    if match is not None:
        address = re.sub(
            " +$",
            "",
            match.group().replace("\r", "").replace("\n", " ").replace("  ", " "),
            flags=re.MULTILINE,
        )
        if address is not None:
            if office["type"] == "Capitol Address":
                p.capitol_office.address = address
            elif office["type"] == "District Address":
                p.district_office.address = address
    phone_number = extract_phone(details)
    fax_number = extract_fax(details)
    if phone_number:
        if office["type"] == "Capitol Address":
            p.capitol_office.voice = phone_number
        elif office["type"] == "District Address":
            p.district_office.voice = phone_number
    if fax_number:
        if office["type"] == "Capitol Address":
            p.capitol_office.fax = fax_number
        elif office["type"] == "District Address":
            p.district_office.fax = fax_number
    return p