<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(nodelist, node, label=None, sep='_'):
 """ Append function to automate the naming of list elements in Containers. :Arguments: - `nodelist` : List containing nodes for Container. - `node` : Node to be added to list. - `label` : Label to be appended to list (If not passed, defaults to element number). - `sep` : Separator character for label (defaults to underscore). :Return: - `nodelist` : Passed list with node added. """


    nname = node.__name__

    # Determine label
    label = label or len(nodelist)

    # Look for separator at the end of name
    ind = nname.rfind(sep)

    # If there is no separator, we will remove last character and
    # replace with label.
    node.__name__ = nname[:ind] + sep + str(label)

    nodelist.append(node)

    return nodelist