original_docstring: 
          Merge N different HyperLogLogs into a single one.
  
          Cluster impl:
              Very special implementation is required to make pfmerge() work
              But it works :]
              It works by first fetching all HLL objects that should be merged and
              move them to one hashslot so that pfmerge operation can be performed without
              any 'CROSSSLOT' error.
              After the PFMERGE operation is done then it will be moved to the correct location
              within the cluster and cleanup is done.
  
              This operation is no longer atomic because of all the operations that has to be done.
          
docstring: Merge N different HyperLogLogs into a single one.
  Cluster impl:
  Very special implementation is required to make pfmerge() work
  But it works :]
  It works by first fetching all HLL objects that should be merged and
  move them to one hashslot so that pfmerge operation can be performed without
  any 'CROSSSLOT' error.
  After the PFMERGE operation is done then it will be moved to the correct location
  within the cluster and cleanup is done.
  
  This operation is no longer atomic because of all the operations that has to be done.
docstring_tokens: Merge N different HyperLogLogs into a single one . Cluster impl : Very special implementation is required to make pfmerge () work But it works : ] It works by first fetching all HLL objects that should be merged and move them to one hashslot so that pfmerge operation can be performed without any ' CROSSSLOT ' error . After the PFMERGE operation is done then it will be moved to the correct location within the cluster and cleanup is done . This operation is no longer atomic because of all the operations that has to be done .
code: def pfmerge(self, dest, *sources):
          """
          Merge N different HyperLogLogs into a single one.
  
          Cluster impl:
              Very special implementation is required to make pfmerge() work
              But it works :]
              It works by first fetching all HLL objects that should be merged and
              move them to one hashslot so that pfmerge operation can be performed without
              any 'CROSSSLOT' error.
              After the PFMERGE operation is done then it will be moved to the correct location
              within the cluster and cleanup is done.
  
              This operation is no longer atomic because of all the operations that has to be done.
          """
          all_k = []
  
          # Fetch all HLL objects via GET and store them client side as strings
          all_hll_objects = [self.get(hll_key) for hll_key in sources]
  
          # Randomize a keyslot hash that should be used inside {} when doing SET
          random_hash_slot = self._random_id()
  
          # Special handling of dest variable if it allready exists, then it shold be included in the HLL merge
          # dest can exists anywhere in the cluster.
          dest_data = self.get(dest)
  
          if dest_data:
              all_hll_objects.append(dest_data)
  
          # SET all stored HLL objects with SET {RandomHash}RandomKey hll_obj
          for hll_object in all_hll_objects:
              k = self._random_good_hashslot_key(random_hash_slot)
              all_k.append(k)
              self.set(k, hll_object)
  
          # Do regular PFMERGE operation and store value in random key in {RandomHash}
          tmp_dest = self._random_good_hashslot_key(random_hash_slot)
          self.execute_command("PFMERGE", tmp_dest, *all_k)
  
          # Do GET and SET so that result will be stored in the destination object any where in the cluster
          parsed_dest = self.get(tmp_dest)
          self.set(dest, parsed_dest)
  
          # Cleanup tmp variables
          self.delete(tmp_dest)
  
          for k in all_k:
              self.delete(k)
  
          return True
code_tokens: def pfmerge ( self , dest , * sources ) : all_k = [ ] all_hll_objects = [ self . get ( hll_key ) for hll_key in sources ] random_hash_slot = self . _random_id ( ) dest_data = self . get ( dest ) if dest_data : all_hll_objects . append ( dest_data ) for hll_object in all_hll_objects : k = self . _random_good_hashslot_key ( random_hash_slot ) all_k . append ( k ) self . set ( k , hll_object ) tmp_dest = self . _random_good_hashslot_key ( random_hash_slot ) self . execute_command ( "PFMERGE" , tmp_dest , * all_k ) parsed_dest = self . get ( tmp_dest ) self . set ( dest , parsed_dest ) self . delete ( tmp_dest ) for k in all_k : self . delete ( k ) return True
short_docstring: Merge N different HyperLogLogs into a single one.
short_docstring_tokens: Merge N different HyperLogLogs into a single one .
comment: """
          Merge N different HyperLogLogs into a single one.
  
          Cluster impl:
              Very special implementation is required to make pfmerge() work
              But it works :]
              It works by first fetching all HLL objects that should be merged and
              move them to one hashslot so that pfmerge operation can be performed without
              any 'CROSSSLOT' error.
              After the PFMERGE operation is done then it will be moved to the correct location
              within the cluster and cleanup is done.
  
              This operation is no longer atomic because of all the operations that has to be done.
          """$SEP$# Fetch all HLL objects via GET and store them client side as strings$SEP$# Randomize a keyslot hash that should be used inside {} when doing SET$SEP$# Special handling of dest variable if it allready exists, then it shold be included in the HLL merge$SEP$# dest can exists anywhere in the cluster.$SEP$# SET all stored HLL objects with SET {RandomHash}RandomKey hll_obj$SEP$# Do regular PFMERGE operation and store value in random key in {RandomHash}$SEP$# Do GET and SET so that result will be stored in the destination object any where in the cluster$SEP$# Cleanup tmp variables