':param branch_setting_func: a function that returns the default branch setting for this object.
If not specified, ModuleStoreEnum.Branch.published_only is used as the default setting.'

def __init__(self, *args, **kwargs):

    self.default_branch_setting_func = kwargs.pop('branch_setting_func', (lambda : ModuleStoreEnum.Branch.published_only))
    super(BranchSettingMixin, self).__init__(*args, **kwargs)
    self.thread_cache = threading.local()
