<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sign(node=None):
 """ Sign a specific node to grant it access you can specify "all" to sign all nodes returns the nodes that were signed """

    if not node:
        raise Exception("Specify either 'all' your specify token/host_name of node to sign. ")
    if node == 'all':
        node = 'unsigned'
    nodes = list_nodes(search=node)
    result = {}
    for token, i in nodes.items():
        i['access'] = 'node'
        i.save()
        result[token] = i
    return result