def parse_optimizer_scope(update_op_name):
    """
    Given the name of an update_op, return its optimizer name scope.

    Args:
        update_op_name: the name of an update_op (usually ResourceApply).

    Returns:
        str: The outermost name scope of the optimizer
    """
    first_pos = update_op_name.find('/')
    second_pos = update_op_name.find('/', first_pos + 1)
    return update_op_name[:second_pos + 1]