def register_run(
        self,
        run_key,
        config,
        results=None,
        overwrite=False,
        cleanup=True,
        cache=True,
    ):
        """Registers a run under the given key on this collection.

        Args:
            run_key: a run key
            config: a :class:`fiftyone.core.runs.RunConfig`
            results (None): an optional :class:`fiftyone.core.runs.RunResults`
            overwrite (False): whether to allow overwriting an existing run of
                the same type
            cleanup (True): whether to execute an existing run's
                :meth:`fiftyone.core.runs.Run.cleanup` method when overwriting
                it
            cache (True): whether to cache the results on the collection
        """
        if not isinstance(config, fors.RunConfig):
            raise ValueError(
                "Expected config of type %s; found %s"
                % (fors.RunConfig, type(config))
            )

        run = config.build()
        run.ensure_requirements()

        run.register_run(self, run_key, overwrite=overwrite, cleanup=cleanup)

        if results is not None:
            if not isinstance(results, fors.RunResults):
                raise ValueError(
                    "Expected results of type %s; found %s"
                    % (fors.RunResults, type(results))
                )

            run.save_run_results(
                self, run_key, results, overwrite=overwrite, cache=cache
            )
Registers a run under the given key on this collection.

        Args:
            run_key: a run key
            config: a :class:`fiftyone.core.runs.RunConfig`
            results (None): an optional :class:`fiftyone.core.runs.RunResults`
            overwrite (False): whether to allow overwriting an existing run of
                the same type
            cleanup (True): whether to execute an existing run's
                :meth:`fiftyone.core.runs.Run.cleanup` method when overwriting
                it
            cache (True): whether to cache the results on the collection
        
fiftyone/core/collections.py