<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fpp_config(koi, **kwargs):
 """returns 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,'fpp.ini'))

    koi = ku.koiname(koi)

    rowefit = jrowe_fit(koi)

    config['name'] = koi
    ra,dec = ku.radec(koi)
    config['ra'] = ra
    config['dec'] = dec
    config['rprs'] = rowefit.ix['RD1','val']
    config['period'] = rowefit.ix['PE1', 'val']

    config['starfield'] = kepler_starfield_file(koi)

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

    config['constraints'] = {}
    config['constraints']['maxrad'] = default_r_exclusion(koi)
    try:
        config['constraints']['secthresh'] = pipeline_weaksec(koi)
    except NoWeakSecondaryError:
        pass

    return config