'Get usage info for unit/module.'

@staticmethod
def _get_usage_info(course, unit, item, usage_info, group_id, scheme_name=None):

    parent_unit = get_parent_unit(item)
    if ((unit == parent_unit) and (not item.has_children)):
        unit_for_url = unit
    elif (((not parent_unit) and unit.get_parent()) or ((unit == parent_unit) and item.has_children)):
        unit_for_url = item
    else:
        parent = item.get_parent()
        nested_vertical = item
        while (parent != parent_unit):
            nested_vertical = parent
            parent = parent.get_parent()
        unit_for_url = nested_vertical
    unit_url = reverse_usage_url('container_handler', course.location.course_key.make_usage_key(unit_for_url.location.block_type, unit_for_url.location.name))
    usage_dict = {'label': u'{}    /    {}'.format(unit.display_name, item.display_name), 'url': unit_url}
    if (scheme_name == RANDOM_SCHEME):
        validation_summary = item.general_validation_message()
        usage_dict.update({'validation': (validation_summary.to_json() if validation_summary else None)})
    usage_info[group_id].append(usage_dict)
    return usage_info
