def generate_flare_lightcurve(<EOL>times,<EOL>mags=None,<EOL>errs=None,<EOL>paramdists={<EOL>'<STR_LIT>':sps.uniform(loc=<NUM_LIT>,scale=<NUM_LIT>),<EOL>'<STR_LIT>':[<NUM_LIT:1>,<NUM_LIT:5>],<EOL>'<STR_LIT>':sps.uniform(loc=<NUM_LIT>, scale=<NUM_LIT>),<EOL>'<STR_LIT>':sps.uniform(loc=<NUM_LIT>, scale=<NUM_LIT>)<EOL>},<EOL>magsarefluxes=False,<EOL>):
if mags is None:<EOL><INDENT>mags = np.full_like(times, <NUM_LIT:0.0>)<EOL><DEDENT>if errs is None:<EOL><INDENT>errs = np.full_like(times, <NUM_LIT:0.0>)<EOL><DEDENT>nflares = npr.randint(paramdists['<STR_LIT>'][<NUM_LIT:0>],<EOL>high=paramdists['<STR_LIT>'][<NUM_LIT:1>])<EOL>flarepeaktimes = (<EOL>npr.random(<EOL>size=nflares<EOL>)*(times.max() - times.min()) + times.min()<EOL>)<EOL>params = {'<STR_LIT>':nflares}<EOL>for flareind, peaktime in zip(range(nflares), flarepeaktimes):<EOL><INDENT>amp = paramdists['<STR_LIT>'].rvs(size=<NUM_LIT:1>)<EOL>risestdev = paramdists['<STR_LIT>'].rvs(size=<NUM_LIT:1>)<EOL>decayconst = paramdists['<STR_LIT>'].rvs(size=<NUM_LIT:1>)<EOL>if magsarefluxes and amp < <NUM_LIT:0.0>:<EOL><INDENT>amp = -amp<EOL><DEDENT>elif not magsarefluxes and amp > <NUM_LIT:0.0>:<EOL><INDENT>amp = -amp<EOL><DEDENT>modelmags, ptimes, pmags, perrs = (<EOL>flares.flare_model(<EOL>[amp, peaktime, risestdev, decayconst],<EOL>times,<EOL>mags,<EOL>errs<EOL>)<EOL>)<EOL>mags = modelmags<EOL>params[flareind] = {'<STR_LIT>':peaktime,<EOL>'<STR_LIT>':amp,<EOL>'<STR_LIT>':risestdev,<EOL>'<STR_LIT>':decayconst}<EOL><DEDENT>modeldict = {<EOL>'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':params,<EOL>'<STR_LIT>':times,<EOL>'<STR_LIT>':mags,<EOL>'<STR_LIT>':errs,<EOL>'<STR_LIT>':None,<EOL>'<STR_LIT>':[params[x]['<STR_LIT>']<EOL>for x in range(params['<STR_LIT>'])],<EOL>}<EOL>return modeldict<EOL>
This generates fake flare light curves.

    Parameters
    ----------

    times : np.array
        This is an array of time values that will be used as the time base.

    mags,errs : np.array
        These arrays will have the model added to them. If either is
        None, `np.full_like(times, 0.0)` will used as a substitute and the model
        light curve will be centered around 0.0.

    paramdists : dict
        This is a dict containing parameter distributions to use for the
        model params, containing the following keys ::

            {'amplitude', 'nflares', 'risestdev', 'decayconst'}

        The values of these keys should all be 'frozen' scipy.stats distribution
        objects, e.g.:

        https://docs.scipy.org/doc/scipy/reference/stats.html#continuous-distributions
        The `flare_peak_time` for each flare will be generated automatically
        between `times.min()` and `times.max()` using a uniform distribution.

        The `amplitude` will be flipped automatically as appropriate if
        `magsarefluxes=True`.

    magsarefluxes : bool
        If the generated time series is meant to be a flux time-series, set this
        to True to get the correct sign of variability amplitude.

    Returns
    -------

    dict
        A dict of the form below is returned::

            {'vartype': 'flare',
             'params': {'amplitude': generated value of flare amplitudes,
                        'nflares': generated value of number of flares,
                        'risestdev': generated value of stdev of rise time,
                        'decayconst': generated value of decay constant,
                        'peaktime': generated value of flare peak time},
             'times': the model times,
             'mags': the model mags,
             'errs': the model errs,
             'varamplitude': the generated amplitude of
                             variability == 'amplitude'}