'Gets block at the head of specified branch'

def _get_head(self, xblock, branch):

    try:
        course_structure = self._lookup_course(xblock.location.course_key.for_branch(branch)).structure
    except ItemNotFoundError:
        return None
    return self._get_block_from_structure(course_structure, BlockKey.from_usage_key(xblock.location))
