def partition(self, key, partitions=None):
raise NotImplementedError('<STR_LIT>')<EOL>
Takes a string key and num_partitions as argument and returns
a partition to be used for the message

Arguments:
    key: the key to use for partitioning
    partitions: (optional) a list of partitions.