# Buggy code
def _prepare_for_stage(self, stage: str):
    utils.set_global_seed(self.experiment.initial_seed)
    migrating_params = {}
    stage_state_params = self.experiment.get_state_params(stage)
    migrate_from_previous_stage = stage_state_params.get(
        "migrate_from_previous_stage", True
    )
    if self.state is not None and migrate_from_previous_stage:
        migrating_params.update({"step": self.state.step, "epoch": self.state.epoch})

    utils.set_global_seed(self.experiment.initial_seed)
    self.model, criterion, optimizer, scheduler, self.device = (
        self._get_experiment_components(stage)
    )

    utils.set_global_seed(self.experiment.initial_seed)
    self.state = self.state_fn(
        stage=stage,
        model=self.model,
        device=self.device,
        criterion=criterion,
        optimizer=optimizer,
        scheduler=scheduler,
        **stage_state_params,
        **migrating_params,
    )

    utils.set_global_seed(self.experiment.initial_seed)
    callbacks = self.experiment.get_callbacks(stage)

    loggers = utils.process_callbacks(
        OrderedDict(
            [(k, v) for k, v in callbacks.items() if isinstance(v, LoggerCallback)]
        )
    )
    callbacks = utils.process_callbacks(
        OrderedDict(
            [(k, v) for k, v in callbacks.items() if not isinstance(v, LoggerCallback)]
        )
    )

    self.state.loggers = loggers
    self.loggers = loggers
    self.callbacks = callbacks


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-279a2ce060b8> in <module>
24     monitoring_params={
25         'project': "yt",
---> 26         'group': "aa"
27     }
28 )

~/.local/lib/python3.6/site-packages/catalyst/dl/runner/supervised.py in train(self, model, criterion, optimizer, loaders, logdir, callbacks, scheduler, resume, num_epochs, valid_loader, main_metric, minimize_metric, verbose, state_kwargs, checkpoint_data, fp16, monitoring_params, check)
204             monitoring_params=monitoring_params
205         )
--> 206         self.run_experiment(experiment, check=check)
207
208     def infer(

~/.local/lib/python3.6/site-packages/catalyst/contrib/dl/runner/wandb.py in run_experiment(self, experiment, check)
141         self._pre_experiment_hook(experiment=experiment)
142         super().run_experiment(experiment=experiment, check=check)
--> 143         self._post_experiment_hook(experiment=experiment)
144
145

~/.local/lib/python3.6/site-packages/catalyst/contrib/dl/runner/wandb.py in _post_experiment_hook(self, experiment)
104
105         checkpoint_paths = []
--> 106         for glob in self.checkpoints_glob:
107             checkpoint_paths.extend(list(checkpoints_src.glob(glob)))
108         checkpoint_paths = list(set(checkpoint_paths))

TypeError: 'NoneType' object is not iterable

# Fixed code
def _prepare_for_stage(self, stage: str):
    utils.set_global_seed(self.experiment.initial_seed)

    migrating_params = dict(**self.experiment.get_state_params(stage))
    migrate_from_previous_stage = migrating_params.get(
        "migrate_from_previous_stage", True
    )
    if self.state is not None and migrate_from_previous_stage:
        migrating_params.update(
            {
                "step": self.state.step,
                "epoch": self.state.epoch,
                "resume": getattr(self.state, "resume", None),
            }
        )

    utils.set_global_seed(self.experiment.initial_seed)
    self.model, criterion, optimizer, scheduler, self.device = (
        self._get_experiment_components(stage)
    )

    utils.set_global_seed(self.experiment.initial_seed)
    self.state = self.state_fn(
        stage=stage,
        model=self.model,
        device=self.device,
        criterion=criterion,
        optimizer=optimizer,
        scheduler=scheduler,
        **migrating_params,
    )

    utils.set_global_seed(self.experiment.initial_seed)
    callbacks = self.experiment.get_callbacks(stage)

    loggers = utils.process_callbacks(
        OrderedDict(
            [(k, v) for k, v in callbacks.items() if isinstance(v, LoggerCallback)]
        )
    )
    callbacks = utils.process_callbacks(
        OrderedDict(
            [(k, v) for k, v in callbacks.items() if not isinstance(v, LoggerCallback)]
        )
    )

    self.state.loggers = loggers
    self.loggers = loggers
    self.callbacks = callbacks