original_docstring: 
          Fetch users.
  
          Fetches user list who has conversation with the agent
  
          :param collection: collection to connect to
          :param month: default is current month and max is last 6 months
          :return: list of user id
          
docstring: Fetch users.
  Fetches user list who has conversation with the agent
docstring_tokens: Fetch users . Fetches user list who has conversation with the agent
code: def fetch_chat_users(collection: Text, month: int = 1):
  
          """
          Fetch users.
  
          Fetches user list who has conversation with the agent
  
          :param collection: collection to connect to
          :param month: default is current month and max is last 6 months
          :return: list of user id
          """
          client, message = HistoryProcessor.get_mongo_connection()
          message = ' '.join([message, f', collection: {collection}'])
          with client as client:
              db = client.get_database()
              conversations = db.get_collection(collection)
              try:
                  values = conversations.find({"events.timestamp": {"$gte": Utility.get_timestamp_previous_month(month)}},
                                              {"_id": 0, "sender_id": 1})
                  users = [
                      sender["sender_id"]
                      for sender in values
                  ]
                  return users, message
              except ServerSelectionTimeoutError as e:
                  logger.error(e)
                  raise AppException(f'Could not connect to tracker: {e}')
              except Exception as e:
                  logger.error(e)
                  raise AppException(e)
code_tokens: def fetch_chat_users ( collection : Text , month : int = 1 ) : client , message = HistoryProcessor . get_mongo_connection ( ) message = ' ' . join ( [ message , f', collection: {collection}' ] ) with client as client : db = client . get_database ( ) conversations = db . get_collection ( collection ) try : values = conversations . find ( { "events.timestamp" : { "$gte" : Utility . get_timestamp_previous_month ( month ) } } , { "_id" : 0 , "sender_id" : 1 } ) users = [ sender [ "sender_id" ] for sender in values ] return users , message except ServerSelectionTimeoutError as e : logger . error ( e ) raise AppException ( f'Could not connect to tracker: {e}' ) except Exception as e : logger . error ( e ) raise AppException ( e )
short_docstring: Fetch users.
short_docstring_tokens: Fetch users .
comment: """
          Fetch users.
  
          Fetches user list who has conversation with the agent
  
          :param collection: collection to connect to
          :param month: default is current month and max is last 6 months
          :return: list of user id
          """