def get_parent_xblock(xblock):
 locator = xblock.location
 parent_location = modulestore().get_parent_location(locator)
 if (parent_location is None):
  return None
 return modulestore().get_item(parent_location)

def get_parent_xblock ( xblock ) : locator = xblock . location parent_location = modulestore ( ) . get_parent_location ( locator ) if ( parent_location is None ) : return None return modulestore ( ) . get_item ( parent_location )
returns the xblock that is the parent of the specified xblock .