code: def event_return(events):
      '''
      Return events to Mongodb server
      '''
      conn, mdb = _get_conn(ret=None)
  
      if isinstance(events, list):
          events = events[0]
  
      if isinstance(events, dict):
          log.debug(events)
  
          if PYMONGO_VERSION > _LooseVersion('2.3'):
              mdb.events.insert_one(events.copy())
          else:
              mdb.events.insert(events.copy()f event_return(events):
      '''
      Return events to Mongodb server
      '''
      conn, mdb = _get_conn(ret=None)
  
      if isinstance(events, list):
          events = events[0]
  
      if isinstance(events, dict):
          log.debug(events)
  
          if PYMONGO_VERSION > _LooseVersion('2.3'):
              mdb.events.insert_one(events.copy())
          else:
              mdb.events.insert(events.copy())
docs: Return events to Mongodb server