def is_unit(xblock, parent_xblock=None):
 if (xblock.category == 'vertical'):
  if (parent_xblock is None):
   parent_xblock = get_parent_xblock(xblock)
  parent_category = (parent_xblock.category if parent_xblock else None)
  return (parent_category == 'sequential')
 return False

def is_unit ( xblock , parent_xblock = None ) : if ( xblock . category == 'vertical' ) : if ( parent_xblock is None ) : parent_xblock = get_parent_xblock ( xblock ) parent_category = ( parent_xblock . category if parent_xblock else None ) return ( parent_category == 'sequential' ) return False
returns true if the specified xblock is a vertical that is treated as a unit .