def collect(self, app_id, exp_config=None, bot=False, **kwargs):
try:<EOL><INDENT>results = data_load(app_id)<EOL>self.log(<EOL>"<STR_LIT>".format(app_id),<EOL>key="<STR_LIT>",<EOL>)<EOL>return results<EOL><DEDENT>except IOError:<EOL><INDENT>self.log(<EOL>"<STR_LIT>".format(app_id),<EOL>key="<STR_LIT>",<EOL>)<EOL><DEDENT>exp_config = exp_config or {}<EOL>if is_registered(app_id):<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>".format(app_id)<EOL>+ "<STR_LIT>"<EOL>)<EOL><DEDENT>elif kwargs.get("<STR_LIT>") == "<STR_LIT>" or exp_config.get("<STR_LIT>") == "<STR_LIT>":<EOL><INDENT>raise RuntimeError("<STR_LIT>".format(app_id))<EOL><DEDENT>try:<EOL><INDENT>assert isinstance(uuid.UUID(app_id, version=<NUM_LIT:4>), uuid.UUID)<EOL><DEDENT>except (ValueError, AssertionError):<EOL><INDENT>raise ValueError("<STR_LIT>".format(app_id))<EOL><DEDENT>self.log(<EOL>"<STR_LIT>".format(app_id),<EOL>key="<STR_LIT>",<EOL>)<EOL>return self.run(exp_config, app_id, bot, **kwargs)<EOL>
Collect data for the provided experiment id.

        The ``app_id`` parameter must be a valid UUID.
        If an existing data file is found for the UUID it will
        be returned, otherwise - if the UUID is not already registered -
        the experiment will be run and data collected.

        See :meth:`~Experiment.run` method for other parameters.