# Path: atmos/utils.py
# def print_if(msg, condition, printfunc=None):
#     """ Print msg if condition is True"""
#     if condition:
#         if printfunc is not None:
#             printfunc(msg)
#         else:
#             print(msg)
# 
# def disptime(fmt=None):
#     now = datetime.now()
# 
#     if fmt == None:
#         fmt = '%02d/%02d/%02d %02d:%02d:%02d'
#     now = (fmt % (now.month, now.day, now.year, now.hour, now.minute,
#            now.second))
#     print(now)
#     return now


import numpy as np
import collections
import xarray as xray
import atmos.utils as utils
from xarray import Dataset
from atmos.utils import print_if, disptime
    """
    ds = dataset
    for var in ds.data_vars:
        print_if(var, verbose)
        vals = ds[var].values
        attrs = ds[var].attrs
        print_if(attrs, verbose, printfunc=utils.print_odict)

        # Flag missing values for further processing
        if missing_name in attrs:
            missing_val = attrs[missing_name]
            imissing = vals == missing_val
            print_if('missing_val ' + str(missing_val), verbose)
            print_if('Found ' + str(imissing.sum()) + ' missings', verbose)
        else:
            imissing = []
            print_if('Missing values not flagged in input file', verbose)

        # Get offset and scaling factors, if any
        if offset_name in attrs:
            offset_val = attrs[offset_name]
            print_if('offset val ' + str(offset_val), verbose)
        else:
            offset_val = 0.0
            print_if('No offset in input file, setting to 0.0', verbose)
        if scale_name in attrs:
            scale_val = attrs[scale_name]
            print_if('scale val ' + str(scale_val), verbose)
        else:
            scale_val = 1.0

# Path: atmos/utils.py
# def print_if(msg, condition, printfunc=None):
#     """ Print msg if condition is True"""
#     if condition:
#         if printfunc is not None:
#             printfunc(msg)
#         else:
#             print(msg)
# 
# def disptime(fmt=None):
#     now = datetime.now()
# 
#     if fmt == None:
#         fmt = '%02d/%02d/%02d %02d:%02d:%02d'
#     now = (fmt % (now.month, now.day, now.year, now.hour, now.minute,
#            now.second))
#     print(now)
#     return now


# Path: atmos/xrhelper.py
import numpy as np
import collections
import xarray as xray
import atmos.utils as utils
from xarray import Dataset
from atmos.utils import print_if, disptime

    """
    ds = dataset
    for var in ds.data_vars:
        print_if(var, verbose)
        vals = ds[var].values
        attrs = ds[var].attrs
        print_if(attrs, verbose, printfunc=utils.print_odict)

        # Flag missing values for further processing
        if missing_name in attrs:
            missing_val = attrs[missing_name]
            imissing = vals == missing_val
            print_if('missing_val ' + str(missing_val), verbose)
            print_if('Found ' + str(imissing.sum()) + ' missings', verbose)
        else:
            imissing = []
            print_if('Missing values not flagged in input file', verbose)

        # Get offset and scaling factors, if any
        if offset_name in attrs:
            offset_val = attrs[offset_name]
            print_if('offset val ' + str(offset_val), verbose)
        else:
            offset_val = 0.0
            print_if('No offset in input file, setting to 0.0', verbose)
        if scale_name in attrs:
            scale_val = attrs[scale_name]
            print_if('scale val ' + str(scale_val), verbose)
        else:
            scale_val = 1.0

            print_if('No scaling in input file, setting to 1.0', verbose)