def get_max_id(corpus):
 maxid = (-1)
 for document in corpus:
  maxid = max(maxid, max(([(-1)] + [fieldid for (fieldid, _) in document])))
 return maxid

def get_max_id ( corpus ) : maxid = ( - 1 ) for document in corpus : maxid = max ( maxid , max ( ( [ ( - 1 ) ] + [ fieldid for ( fieldid , _ ) in document ] ) ) ) return maxid
return the highest feature id that appears in the corpus .