# Path: tooz/_retry.py
# def retry(stop_max_delay=None, **kwargs):
# 
# Path: tooz/partitioner.py
# class Partitioner(object):
#     DEFAULT_PARTITION_NUMBER = hashring.HashRing.DEFAULT_PARTITION_NUMBER
#     def __init__(self, coordinator, group_id,
#                  partitions=DEFAULT_PARTITION_NUMBER):
#     def _on_member_join(self, event):
#     def _on_member_leave(self, event):
#     def _hash_object(obj):
#     def members_for_object(self, obj, ignore_members=None, replicas=1):
#     def belongs_to_member(self, obj, member_id,
#                           ignore_members=None, replicas=1):
#     def belongs_to_self(self, obj, ignore_members=None, replicas=1):
#     def stop(self):
# 
# Path: tooz/utils.py
# class Base64LockEncoder(object):
# class ProxyExecutor(object):
# class SerializationError(tooz.ToozError):
#     def __init__(self, keyspace_url, prefix=''):
#     def check_and_encode(self, name):
#     def encode(self, name):
#     def __init__(self, driver_name, default_executor_factory):
#     def build(cls, driver_name, options):
#     def start(self):
#     def stop(self):
#     def submit(self, cb, *args, **kwargs):
# def safe_abs_path(rooted_at, *pieces):
# def convert_blocking(blocking):
# def collapse(config, exclude=None, item_selector=operator.itemgetter(-1)):
# def to_binary(text, encoding='ascii'):
# def dumps(data, excp_cls=SerializationError):
# def loads(blob, excp_cls=SerializationError):
# def millis_to_datetime(milliseconds):
# def raise_with_cause(exc_cls, message, *args, **kwargs):
#     KIND_TO_FACTORY = {
#         'threaded': (lambda:
#                      futurist.ThreadPoolExecutor(max_workers=1)),
#         'synchronous': lambda: futurist.SynchronousExecutor(),
#     }
#     DEFAULT_KIND = 'threaded'


import abc
import collections
import enum
import logging
import threading
import urllib
import tenacity
import tooz
from concurrent import futures
from oslo_utils import encodeutils
from oslo_utils import netutils
from oslo_utils import timeutils
from stevedore import driver
from tooz import _retry
from tooz import partitioner
from tooz import utils
    def join_partitioned_group(
            self, group_id,
            weight=1,
            partitions=partitioner.Partitioner.DEFAULT_PARTITION_NUMBER):
        """Join a group and get a partitioner.

        A partitioner allows to distribute a bunch of objects across several
        members using a consistent hash ring. Each object gets assigned (at
        least) one member responsible for it. It's then possible to check which
        object is owned by any member of the group.

        This method also creates if necessary, and joins the group with the
        selected weight.

        :param group_id: The group to create a partitioner for.
        :param weight: The weight to use in the hashring for this node.
        :param partitions: The number of partitions to create.
        :return: A :py:class:`~tooz.partitioner.Partitioner` object.

        """
        self.join_group_create(group_id, capabilities={'weight': weight})
        return partitioner.Partitioner(self, group_id, partitions=partitions)

    def leave_partitioned_group(self, partitioner):
        """Leave a partitioned group.

        This leaves the partitioned group and stop the partitioner.
        :param group_id: The group to create a partitioner for.
        """
        leave = self.leave_group(partitioner.group_id)

# Path: tooz/_retry.py
# def retry(stop_max_delay=None, **kwargs):
# 
# Path: tooz/partitioner.py
# class Partitioner(object):
#     DEFAULT_PARTITION_NUMBER = hashring.HashRing.DEFAULT_PARTITION_NUMBER
#     def __init__(self, coordinator, group_id,
#                  partitions=DEFAULT_PARTITION_NUMBER):
#     def _on_member_join(self, event):
#     def _on_member_leave(self, event):
#     def _hash_object(obj):
#     def members_for_object(self, obj, ignore_members=None, replicas=1):
#     def belongs_to_member(self, obj, member_id,
#                           ignore_members=None, replicas=1):
#     def belongs_to_self(self, obj, ignore_members=None, replicas=1):
#     def stop(self):
# 
# Path: tooz/utils.py
# class Base64LockEncoder(object):
# class ProxyExecutor(object):
# class SerializationError(tooz.ToozError):
#     def __init__(self, keyspace_url, prefix=''):
#     def check_and_encode(self, name):
#     def encode(self, name):
#     def __init__(self, driver_name, default_executor_factory):
#     def build(cls, driver_name, options):
#     def start(self):
#     def stop(self):
#     def submit(self, cb, *args, **kwargs):
# def safe_abs_path(rooted_at, *pieces):
# def convert_blocking(blocking):
# def collapse(config, exclude=None, item_selector=operator.itemgetter(-1)):
# def to_binary(text, encoding='ascii'):
# def dumps(data, excp_cls=SerializationError):
# def loads(blob, excp_cls=SerializationError):
# def millis_to_datetime(milliseconds):
# def raise_with_cause(exc_cls, message, *args, **kwargs):
#     KIND_TO_FACTORY = {
#         'threaded': (lambda:
#                      futurist.ThreadPoolExecutor(max_workers=1)),
#         'synchronous': lambda: futurist.SynchronousExecutor(),
#     }
#     DEFAULT_KIND = 'threaded'


# Path: tooz/coordination.py
import abc
import collections
import enum
import logging
import threading
import urllib
import tenacity
import tooz
from concurrent import futures
from oslo_utils import encodeutils
from oslo_utils import netutils
from oslo_utils import timeutils
from stevedore import driver
from tooz import _retry
from tooz import partitioner
from tooz import utils

    def join_partitioned_group(
            self, group_id,
            weight=1,
            partitions=partitioner.Partitioner.DEFAULT_PARTITION_NUMBER):
        """Join a group and get a partitioner.

        A partitioner allows to distribute a bunch of objects across several
        members using a consistent hash ring. Each object gets assigned (at
        least) one member responsible for it. It's then possible to check which
        object is owned by any member of the group.

        This method also creates if necessary, and joins the group with the
        selected weight.

        :param group_id: The group to create a partitioner for.
        :param weight: The weight to use in the hashring for this node.
        :param partitions: The number of partitions to create.
        :return: A :py:class:`~tooz.partitioner.Partitioner` object.

        """
        self.join_group_create(group_id, capabilities={'weight': weight})
        return partitioner.Partitioner(self, group_id, partitions=partitions)

    def leave_partitioned_group(self, partitioner):
        """Leave a partitioned group.

        This leaves the partitioned group and stop the partitioner.
        :param group_id: The group to create a partitioner for.
        """
        leave = self.leave_group(partitioner.group_id)

        partitioner.stop()