docs: def encode_safely(self, data):
          """Encode the data.
          """
          
          encoder = self.base_encoder
          result = settings.null
  
          try:
              result = encoder(pickle.dumps(data))
          except:
              warnings.warn("Data could not be serialized.", RuntimeWarning)
          return result