docs: def get_db(db, ip='localhost', port=27017, user=None, password=None):
      '''
      Returns a pymongo Database object.
  
      .. note:
  
          Both ``user`` and ``password`` are required when connecting to a MongoDB
          database that has authentication enabled.
  
      Arguments:
  
          db (str): Name of the MongoDB database. Required.
  
          ip (str): IP address of the MongoDB server. Default is ``localhost``.
  
          port (int): Port of the MongoDB server. Default is ``27017``.
  
          user (str): Username, if authentication is enabled on the MongoDB database.
              Default is ``None``, which results in requesting the connection
              without authentication.
  
          password (str): Password, if authentication is enabled on the MongoDB database.
              Default is ``None``, which results in requesting the connection
              without authentication.
      '''
      if platform.system().lower() == 'darwin':
          connect = False
      else:
          connect = True
      if user and password:
          import urllib
          pwd = urllib.quote_plus(password)
          uri = 'mongodb://{}:{}@{}:{}'.format(user, pwd, ip, port)
          conn = MongoClient(uri, connect=connect)
      else:
          conn = MongoClient(ip, port, connect=connect)
      return conn[db]