def xblock_type_display_name(xblock, default_display_name=None):
 if hasattr(xblock, 'category'):
  category = xblock.category
  if ((category == 'vertical') and (not is_unit(xblock))):
   return _('Vertical')
 else:
  category = xblock
 if (category == 'chapter'):
  return _('Section')
 elif (category == 'sequential'):
  return _('Subsection')
 elif (category == 'vertical'):
  return _('Unit')
 component_class = XBlock.load_class(category, select=settings.XBLOCK_SELECT_FUNCTION)
 if (hasattr(component_class, 'display_name') and component_class.display_name.default):
  return _(component_class.display_name.default)
 else:
  return default_display_name

def xblock_type_display_name ( xblock , default_display_name = None ) : if hasattr ( xblock , 'category' ) : category = xblock . category if ( ( category == 'vertical' ) and ( not is_unit ( xblock ) ) ) : return _ ( 'Vertical' ) else : category = xblock if ( category == 'chapter' ) : return _ ( 'Section' ) elif ( category == 'sequential' ) : return _ ( 'Subsection' ) elif ( category == 'vertical' ) : return _ ( 'Unit' ) component_class = XBlock . load_class ( category , select = settings . XBLOCK_SELECT_FUNCTION ) if ( hasattr ( component_class , 'display_name' ) and component_class . display_name . default ) : return _ ( component_class . display_name . default ) else : return default_display_name
returns the display name for the specified type of xblock .