<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def node2geoff(node_name, properties, encoder):
 """converts a NetworkX node into a Geoff string. Parameters node_name : str or int the ID of a NetworkX node properties : dict a dictionary of node attributes encoder : json.JSONEncoder an instance of a JSON encoder (e.g. `json.JSONEncoder`) Returns ------- geoff : str a Geoff string """

    if properties:
        return '({0} {1})'.format(node_name,
                                  encoder.encode(properties))
    else:
        return '({0})'.format(node_name)