def __init__(self, dims=None, ndim=None, p: Union[(float, Dict[(int, float)])]=0.0) -> None:
    if ((dims is None) and (ndim is None)):
        raise ValueError('Either `dims` or `ndim` must be specified')
    if all(((x is not None) for x in (dims, ndim))):
        raise ValueError('Only one of `dims` or `ndim` can be specified.')
    if isinstance(dims, int):
        dims = (dims,)
    self.dims = dims
    self.ndim = ndim
    super().__init__(p=p)
def __init__(self, dims=None, ndim=None, p: Union[(float, Dict[(int, float)])]=0.0) -> None:
    if ((dims is None) and (ndim is None)):
        raise ValueError('Either `dims` or `ndim` must be specified')
    if all(((x is not None) for x in (dims, ndim))):
        raise ValueError('Only one of `dims` or `ndim` can be specified.')
    if isinstance(dims, int):
        dims = (dims,)
    self.dims = dims
    self.ndim = ndim
    super().__init__(p=p)