'Returns the current branch_setting on the store.
Returns the thread-local setting, if set.
Otherwise, returns the default value of the setting function set during the store\'s initialization.'

def get_branch_setting(self, course_id=None):

    thread_local_branch_setting = getattr(self.thread_cache, 'branch_setting', None)
    if thread_local_branch_setting:
        return thread_local_branch_setting
    else:
        return self.default_branch_setting_func()
