def encode_node(node_id, links=None, score=1):
 node = {}
 if (links is not None):
  node['links'] = sorted(links.items())
 node['score'] = score
 return (JSONProtocol.write(node_id, node) + '\n')

def encode_node ( node_id , links = None , score = 1 ) : node = { } if ( links is not None ) : node [ 'links' ] = sorted ( links . items ( ) ) node [ 'score' ] = score return ( JSONProtocol . write ( node_id , node ) + '\n' )
print out a node .