def _delete_item(usage_key, user):
 store = modulestore()
 with store.bulk_operations(usage_key.course_key):
  if (usage_key.category == 'static_tab'):
   dog_stats_api.increment(DEPRECATION_VSCOMPAT_EVENT, tags=('location:_delete_item_static_tab', u'course:{}'.format(unicode(usage_key.course_key))))
   course = store.get_course(usage_key.course_key)
   existing_tabs = (course.tabs or [])
   course.tabs = [tab for tab in existing_tabs if (tab.get('url_slug') != usage_key.name)]
   store.update_item(course, user.id)
  store.delete_item(usage_key, user.id)

def _delete_item ( usage_key , user ) : store = modulestore ( ) with store . bulk_operations ( usage_key . course_key ) : if ( usage_key . category == 'static_tab' ) : dog_stats_api . increment ( DEPRECATION_VSCOMPAT_EVENT , tags = ( 'location:_delete_item_static_tab' , u'course:{}' . format ( unicode ( usage_key . course_key ) ) ) ) course = store . get_course ( usage_key . course_key ) existing_tabs = ( course . tabs or [ ] ) course . tabs = [ tab for tab in existing_tabs if ( tab . get ( 'url_slug' ) != usage_key . name ) ] store . update_item ( course , user . id ) store . delete_item ( usage_key , user . id )
deletes an existing xblock with the given usage_key .