def METHOD_NAME(self, obj):
    if inspect.ismodule(obj):
        return module_reducer(obj)
    if isinstance(obj, types.CellType):
        return cell_reducer(obj)
    if inspect.isfunction(obj):
        if isinstance(obj, type(dummy_lambda)) and obj.__name__ == dummy_lambda.__name__ or \
                getattr(obj, '_dali_pickle_by_value', False):
            return function_by_value_reducer(obj)
        try:
            pickle.dumps(obj)
        except AttributeError as e:
            if "Can't pickle local object" in str(e):
                return function_by_value_reducer(obj)
        except pickle.PicklingError as e:
            if "it's not the same object as" in str(e):
                return function_by_value_reducer(obj)
    return NotImplemented