def _raise_document_too_large(operation, doc_size, max_size):
 if (operation == 'insert'):
  raise DocumentTooLarge(('BSON document too large (%d bytes) - the connected server supports BSON document sizes up to %d bytes.' % (doc_size, max_size)))
 else:
  raise DocumentTooLarge('command document too large')

def _raise_document_too_large ( operation , doc_size , max_size ) : if ( operation == 'insert' ) : raise DocumentTooLarge ( ( 'BSON document too large (%d bytes) - the connected server supports BSON document sizes up to %d bytes.' % ( doc_size , max_size ) ) ) else : raise DocumentTooLarge ( 'command document too large' )
internal helper for raising documenttoolarge .