def METHOD_NAME(nnp):
    def get_renamed(str):
        ret_str = str.replace(']', '').replace('[', '_')
        if ret_str != str:
            logger.debug("{} --> {}".format(str, ret_str))
        return ret_str
    def get_renamed_list(func, field, field_name):
        fields = [get_renamed(x) for x in field]
        func.ClearField(field_name)
        field.extend(fields)
    def has_expanded():
        expanded = True
        for n in nnp.network:
            if len(n.repeat_info) > 0:
                expanded = False
        return expanded
    if not has_expanded():
        return
    # check the name of nnp.parameter
    for param in nnp.parameter:
        param.variable_name = get_renamed(param.variable_name)
    # check the name of network
    for n in nnp.network:
        for v in n.variable:
            v.name = get_renamed(v.name)
        for f in n.function:
            fields = [get_renamed(x) for x in f.input]
            f.ClearField("input")
            f.input.extend(fields)
            fields = [get_renamed(x) for x in f.output]
            f.ClearField("output")
            f.output.extend(fields)
    # check the name of optimizer
    for o in nnp.optimizer:
        for p in o.parameter_variable:
            p.variable_name = get_renamed(p.variable_name)
    # check the name of executor
    for e in nnp.executor:
        for e in e.parameter_variable:
            e.variable_name = get_renamed(e.variable_name)