Local porosity theory for the frequency dependent dielectric function of porous rocks and polymer blends