class_docstr: Default partitioner.
  
  Hashes key to partition using murmur2 hashing (from java client)
  If key is None, selects partition randomly from available,
  or from all partitions if none are currently available
docstr: Get the partition corresponding to key
  :param key: partitioning key
  :param all_partitions: list of all partitions sorted by partition ID
  :param available: list of available partitions in no particular order
  :return: one of the values from all_partitions or available
docstr_tok: ["Get","the","partition","corresponding","to","key",":","param","key",":","partitioning","key",":","param","all_partitions",":","list","of","all","partitions","sorted","by","partition","ID",":","param","available",":","list","of","available","partitions","in","no","particular","order",":","return",":","one","of","the","values","from","all_partitions","or","available"]
code: def __call__(cls, key, all_partitions, available):
      """
      Get the partition corresponding to key
      :param key: partitioning key
      :param all_partitions: list of all partitions sorted by partition ID
      :param available: list of available partitions in no particular order
      :return: one of the values from all_partitions or available
      """
      if key is None:
          if available:
              return random.choice(available)
          return random.choice(all_partitions)
  
      idx = murmur2(key)
      idx &= 0x7FFFFFFF
      idx %= len(all_partitions)
      return all_partitions[idx]
  
imports: from __future__ import absolute_import
  import random
  from kafka.vendor import six
label_desc: Use image node_id 1 for calling the DefaultPartitioner obj's underlying member method code with example usage: obj.__call__(cls, key, all_partitions, available) and returns: all_partitions, random, random