<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def star_config(koi, bands=['g','r','i','z','J','H','K'], unc=dict(g=0.05, r=0.05, i=0.05, z=0.05, J=0.02, H=0.02, K=0.02), **kwargs):
 """returns star config object for given KOI """

    folder = os.path.join(KOI_FPPDIR, ku.koiname(koi))
    if not os.path.exists(folder):
        os.makedirs(folder)

    config = ConfigObj(os.path.join(folder,'star.ini'))

    koi = ku.koiname(koi)

    maxAV = koi_maxAV(koi)
    config['maxAV'] = maxAV

    mags = ku.KICmags(koi)
    for band in bands:
        if not np.isnan(mags[band]):
            config[band] = (mags[band], unc[band])
    config['Kepler'] = mags['Kepler']

    kepid = KOIDATA.ix[koi,'kepid']

    if use_property(kepid, 'teff'):
        teff, e_teff = (kicu.DATA.ix[kepid, 'teff'],
                          kicu.DATA.ix[kepid, 'teff_err1'])
        if not any(np.isnan([teff, e_teff])):
            config['Teff'] = (teff, e_teff)

    if use_property(kepid, 'logg'):
        logg, e_logg = (kicu.DATA.ix[kepid, 'logg'],
                          kicu.DATA.ix[kepid, 'logg_err1'])
        if not any(np.isnan([logg, e_logg])):
            config['logg'] = (logg, e_logg)

    if use_property(kepid, 'feh'):
        feh, e_feh = (kicu.DATA.ix[kepid, 'feh'],
                          kicu.DATA.ix[kepid, 'feh_err1'])
        if not any(np.isnan([feh, e_feh])):
            config['feh'] = (feh, e_feh)

    for kw,val in kwargs.items():
        config[kw] = val

    return config