# Path: data_cube_utilities/dc_utilities.py
# def create_default_clean_mask(dataset_in):
#     """
#     Creates a data mask that masks nothing.
#     
#     Parameters
#     ----------
#     dataset_in: xarray.Dataset
#         dataset retrieved from the Data Cube.
#     
#     Raises
#     ------
#     ValueError
#         if dataset_in is an empty xarray.Dataset.
#     """
#     data = None
#     if isinstance(dataset_in, xr.Dataset):
#         data_vars = list(dataset_in.data_vars)
#         if len(data_vars) != 0:
#             data = dataset_in[data_vars[0]].data
#     elif isinstance(dataset_in, xr.DataArray):
#         data = dataset_in.data
#     clean_mask = None
#     if isinstance(data, dask.array.core.Array):
#         clean_mask = dask.array.ones_like(data, dtype='uint8')
#     else:
#         if data is None:
#             clean_mask = np.ones(dataset_in.shape, dtype=np.bool)
#         else:
#             clean_mask = np.ones_like(data, dtype=np.bool)
#     return clean_mask.astype(np.bool)


import os
import gc
import numpy as np
import xarray as xr
import dask
import datacube
import warnings
import argparse
import collections
from osgeo import gdal
from datetime import datetime
from . import dc_utilities as utilities
from .dc_utilities import create_default_clean_mask
        classified[_tmp2] = 0  #Node 34

        _tmp = r1 & ~r11

        r18 = ndi_52 <= 0.34
        classified[_tmp & ~r18] = 0  #Node 36
        _tmp &= r18

        r19 = band1 <= 249.5
        classified[_tmp & ~r19] = 0  #Node 38
        _tmp &= r19

        r20 = ndi_43 <= 0.45
        classified[_tmp & ~r20] = 0  #Node 40
        _tmp &= r20

        r21 = band3 <= 364.5
        classified[_tmp & ~r21] = 0  #Node 42
        _tmp &= r21

        r22 = band1 <= 129.5
        classified[_tmp & r22] = 1  #Node 44
        classified[_tmp & ~r22] = 0  #Node 45

        # Completed regression tree

        return classified

    # Default to masking nothing.
    if clean_mask is None:

# Path: data_cube_utilities/dc_utilities.py
# def create_default_clean_mask(dataset_in):
#     """
#     Creates a data mask that masks nothing.
#     
#     Parameters
#     ----------
#     dataset_in: xarray.Dataset
#         dataset retrieved from the Data Cube.
#     
#     Raises
#     ------
#     ValueError
#         if dataset_in is an empty xarray.Dataset.
#     """
#     data = None
#     if isinstance(dataset_in, xr.Dataset):
#         data_vars = list(dataset_in.data_vars)
#         if len(data_vars) != 0:
#             data = dataset_in[data_vars[0]].data
#     elif isinstance(dataset_in, xr.DataArray):
#         data = dataset_in.data
#     clean_mask = None
#     if isinstance(data, dask.array.core.Array):
#         clean_mask = dask.array.ones_like(data, dtype='uint8')
#     else:
#         if data is None:
#             clean_mask = np.ones(dataset_in.shape, dtype=np.bool)
#         else:
#             clean_mask = np.ones_like(data, dtype=np.bool)
#     return clean_mask.astype(np.bool)


# Path: data_cube_utilities/dc_water_classifier.py
import os
import gc
import numpy as np
import xarray as xr
import dask
import datacube
import warnings
import argparse
import collections
from osgeo import gdal
from datetime import datetime
from . import dc_utilities as utilities
from .dc_utilities import create_default_clean_mask

        classified[_tmp2] = 0  #Node 34

        _tmp = r1 & ~r11

        r18 = ndi_52 <= 0.34
        classified[_tmp & ~r18] = 0  #Node 36
        _tmp &= r18

        r19 = band1 <= 249.5
        classified[_tmp & ~r19] = 0  #Node 38
        _tmp &= r19

        r20 = ndi_43 <= 0.45
        classified[_tmp & ~r20] = 0  #Node 40
        _tmp &= r20

        r21 = band3 <= 364.5
        classified[_tmp & ~r21] = 0  #Node 42
        _tmp &= r21

        r22 = band1 <= 129.5
        classified[_tmp & r22] = 1  #Node 44
        classified[_tmp & ~r22] = 0  #Node 45

        # Completed regression tree

        return classified

    # Default to masking nothing.
    if clean_mask is None:

        clean_mask = create_default_clean_mask(dataset_in)