parameters: (port, read_preference=pymongo.ReadPreference.PRIMARY, timeout_millis=30000)
return_statement: return pymongo.MongoClient(port=port, read_preference=read_preference, **kwargs)
docstring: Returns a pymongo.MongoClient connected on 'port' with a read
      preference of 'read_preference'.
  
      The PyMongo driver will wait up to 'timeout_millis' milliseconds
      before concluding that the server is unavailable.
docstring_summary: Returns a pymongo.MongoClient connected on 'port' with a read
      preference of 'read_preference'.
docstring_tokens: Returns a pymongo . MongoClient connected on port with a read preference of read_preference .
function: def new_mongo_client(port, read_preference=pymongo.ReadPreference.PRIMARY, timeout_millis=30000):
      """
      Returns a pymongo.MongoClient connected on 'port' with a read
      preference of 'read_preference'.
  
      The PyMongo driver will wait up to 'timeout_millis' milliseconds
      before concluding that the server is unavailable.
      """
  
      kwargs = {"connectTimeoutMS": timeout_millis}
      if pymongo.version_tuple[0] >= 3:
          kwargs["serverSelectionTimeoutMS"] = timeout_millis
          kwargs["connect"] = True
  
      return pymongo.MongoClient(port=port, read_preference=read_preference, **kwargs)
function_tokens: def new_mongo_client ( port , read_preference = pymongo . ReadPreference . PRIMARY , timeout_millis = 30000 ) : kwargs = { "connectTimeoutMS" : timeout_millis } if pymongo . version_tuple [ 0 ] >= 3 : kwargs [ "serverSelectionTimeoutMS" ] = timeout_millis kwargs [ "connect" ] = True return pymongo . MongoClient ( port = port , read_preference = read_preference , * * kwargs )