def finalize_checkplot(cpx,<EOL>outdir,<EOL>all_lclistpkl,<EOL>objfits=None):
This is used to prevent any further changes to the checkplot.

    TODO: finish this.

    Use this function after all variable classification, period-finding, and
    object xmatches are done. This function will add a 'final' key to the
    checkplot, which will contain:

    - a phased LC plot with the period and epoch set after review using the
      times, mags, errs after any appropriate filtering and sigclip was done in
      the checkplotserver UI

    - The unphased LC using the times, mags, errs after any appropriate
      filtering and sigclip was done in the checkplotserver UI

    - the same plots for any LC collection neighbors

    - the survey cutout for the object if objfits is provided and checks out

    - a redone neighbor search using GAIA and all light curves in the collection
      even if they don't have at least 1000 observations.

    These items will be shown in a special 'Final' tab in the `checkplotserver`
    webapp (this should be run in `readonly` mode as well). The final tab will
    also contain downloadable links for the checkplot pickle in pkl and PNG
    format, as well as the final times, mags, errs as a gzipped CSV with a
    header containing all of this info.

    Parameters
    ----------

    cpx : dict or str
        This is the path to the checkplot dict or pickle file to process.

    outdir : str
        This is the directory to where the final pickle will be written. If this
        is set to the same dir as `cpx` and `cpx` is a pickle, the function will
        return a failure. This is meant to keep the in-process checkplots
        separate from the finalized versions.

    all_lclistpkl : str or dict
        This is the path to the pickle or the dict created by
        :py:func:`astrobase.lcproc.catalogs.make_lclist` with no restrictions on
        the number of observations (so ALL light curves in the collection). This
        is used to make sure all neighbors of this object in the light curve
        collection have had their proximity to this object noted.

    objfits : str or None
        If this is not None, should be a file path to a FITS file containing a
        WCS header and this object from the instrument that was used to observe
        it. This will be used to make a stamp cutout of the object using the
        actual image it was detected on. This will be a useful comparison to the
        usual DSS POSS-RED2 image used by the checkplots.

    Returns
    -------

    str
        The path to the updated checkplot pickle file with a 'final' key added
        to it , as described above.