# Path: zarr/util.py
# def normalize_storage_path(path: Union[str, bytes, None]) -> str:
# 
#     # handle bytes
#     if isinstance(path, bytes):
#         path = str(path, 'ascii')
# 
#     # ensure str
#     if path is not None and not isinstance(path, str):
#         path = str(path)
# 
#     if path:
# 
#         # convert backslash to forward slash
#         path = path.replace('\\', '/')
# 
#         # ensure no leading slash
#         while len(path) > 0 and path[0] == '/':
#             path = path[1:]
# 
#         # ensure no trailing slash
#         while len(path) > 0 and path[-1] == '/':
#             path = path[:-1]
# 
#         # collapse any repeated slashes
#         previous_char = None
#         collapsed = ''
#         for char in path:
#             if char == '/' and previous_char == '/':
#                 pass
#             else:
#                 collapsed += char
#             previous_char = char
#         path = collapsed
# 
#         # don't allow path segments with just '.' or '..'
#         segments = path.split('/')
#         if any(s in {'.', '..'} for s in segments):
#             raise ValueError("path containing '.' or '..' segment not allowed")
# 
#     else:
#         path = ''
# 
#     return path
# 
# Path: zarr/_storage/store.py
# class Store(BaseStore):
#     """Abstract store class used by implementations following the Zarr v2 spec.
# 
#     Adds public `listdir`, `rename`, and `rmdir` methods on top of BaseStore.
# 
#     .. added: 2.11.0
# 
#     """
# 
#     def listdir(self, path: str = "") -> List[str]:
#         path = normalize_storage_path(path)
#         return _listdir_from_keys(self, path)
# 
#     def rmdir(self, path: str = "") -> None:
#         if not self.is_erasable():
#             raise NotImplementedError(
#                 f'{type(self)} is not erasable, cannot call "rmdir"'
#             )  # pragma: no cover
#         path = normalize_storage_path(path)
#         _rmdir_from_keys(self, path)


import warnings
from numcodecs.compat import ensure_bytes
from zarr.util import normalize_storage_path
from zarr._storage.store import Store
            from azure.storage.blob import ContainerClient
        from azure.core.exceptions import ResourceNotFoundError
        from azure.core.exceptions import ResourceNotFoundError
           Use ``client`` instead.

    blob_service_kwargs : dictionary
        Extra arguments to be passed into the azure blob client, for e.g. when
        using the emulator, pass in blob_service_kwargs={'is_emulated': True}.

        .. deprecated:: 2.8.3
           Use ``client`` instead.

    dimension_separator : {'.', '/'}, optional
        Separator placed between the dimensions of a chunk.

    client : azure.storage.blob.ContainerClient, optional
        And ``azure.storage.blob.ContainerClient`` to connect with. See
        `here <https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python>`_  # noqa
        for more.

        .. versionadded:: 2.8.3

    Notes
    -----
    In order to use this store, you must install the Microsoft Azure Storage SDK for Python,
    ``azure-storage-blob>=12.5.0``.
    """

    def __init__(self, container=None, prefix='', account_name=None, account_key=None,
                 blob_service_kwargs=None, dimension_separator=None,
                 client=None,
                 ):
        self._dimension_separator = dimension_separator

# Path: zarr/util.py
# def normalize_storage_path(path: Union[str, bytes, None]) -> str:
# 
#     # handle bytes
#     if isinstance(path, bytes):
#         path = str(path, 'ascii')
# 
#     # ensure str
#     if path is not None and not isinstance(path, str):
#         path = str(path)
# 
#     if path:
# 
#         # convert backslash to forward slash
#         path = path.replace('\\', '/')
# 
#         # ensure no leading slash
#         while len(path) > 0 and path[0] == '/':
#             path = path[1:]
# 
#         # ensure no trailing slash
#         while len(path) > 0 and path[-1] == '/':
#             path = path[:-1]
# 
#         # collapse any repeated slashes
#         previous_char = None
#         collapsed = ''
#         for char in path:
#             if char == '/' and previous_char == '/':
#                 pass
#             else:
#                 collapsed += char
#             previous_char = char
#         path = collapsed
# 
#         # don't allow path segments with just '.' or '..'
#         segments = path.split('/')
#         if any(s in {'.', '..'} for s in segments):
#             raise ValueError("path containing '.' or '..' segment not allowed")
# 
#     else:
#         path = ''
# 
#     return path
# 
# Path: zarr/_storage/store.py
# class Store(BaseStore):
#     """Abstract store class used by implementations following the Zarr v2 spec.
# 
#     Adds public `listdir`, `rename`, and `rmdir` methods on top of BaseStore.
# 
#     .. added: 2.11.0
# 
#     """
# 
#     def listdir(self, path: str = "") -> List[str]:
#         path = normalize_storage_path(path)
#         return _listdir_from_keys(self, path)
# 
#     def rmdir(self, path: str = "") -> None:
#         if not self.is_erasable():
#             raise NotImplementedError(
#                 f'{type(self)} is not erasable, cannot call "rmdir"'
#             )  # pragma: no cover
#         path = normalize_storage_path(path)
#         _rmdir_from_keys(self, path)


# Path: zarr/_storage/absstore.py
import warnings
from numcodecs.compat import ensure_bytes
from zarr.util import normalize_storage_path
from zarr._storage.store import Store
            from azure.storage.blob import ContainerClient
        from azure.core.exceptions import ResourceNotFoundError
        from azure.core.exceptions import ResourceNotFoundError

           Use ``client`` instead.

    blob_service_kwargs : dictionary
        Extra arguments to be passed into the azure blob client, for e.g. when
        using the emulator, pass in blob_service_kwargs={'is_emulated': True}.

        .. deprecated:: 2.8.3
           Use ``client`` instead.

    dimension_separator : {'.', '/'}, optional
        Separator placed between the dimensions of a chunk.

    client : azure.storage.blob.ContainerClient, optional
        And ``azure.storage.blob.ContainerClient`` to connect with. See
        `here <https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python>`_  # noqa
        for more.

        .. versionadded:: 2.8.3

    Notes
    -----
    In order to use this store, you must install the Microsoft Azure Storage SDK for Python,
    ``azure-storage-blob>=12.5.0``.
    """

    def __init__(self, container=None, prefix='', account_name=None, account_key=None,
                 blob_service_kwargs=None, dimension_separator=None,
                 client=None,
                 ):
        self._dimension_separator = dimension_separator

        self.prefix = normalize_storage_path(prefix)