def primitive_insert(course, num, tab_type, name):
 validate_args(num, tab_type)
 new_tab = CourseTab.from_json({u'type': unicode(tab_type), u'name': unicode(name)})
 tabs = course.tabs
 tabs.insert(num, new_tab)
 modulestore().update_item(course, ModuleStoreEnum.UserID.primitive_command)

def primitive_insert ( course , num , tab_type , name ) : validate_args ( num , tab_type ) new_tab = CourseTab . from_json ( { u'type' : unicode ( tab_type ) , u'name' : unicode ( name ) } ) tabs = course . tabs tabs . insert ( num , new_tab ) modulestore ( ) . update_item ( course , ModuleStoreEnum . UserID . primitive_command )
inserts a new tab at the given number .