Electronic structure of single-walled carbon nanotubes encapsulating potassium