# Path: cis/time_util.py
# class PartialDateTime(object):
#     def __init__(self, year, month=None, day=None, hour=None, minute=None, second=None):
#     def range(self):
#     def min(self):
#     def max(self):
#     def __eq__(self, other):
# def find_last_day_of_month(year, month):
# def calculate_mid_time(t1, t2):
# def convert_time_since_to_std_time(time_array, units):
# def convert_time_using_time_stamp_info_to_std_time(time_array, units, time_stamp_info=None):
# def convert_sec_since_to_std_time(seconds, ref):
# def convert_std_time_to_datetime(std_time):
# def convert_datetime_to_std_time(dt):
# def convert_julian_date_to_std_time(days_since):
# def convert_cube_time_coord_to_standard_time(cube):
# def set_year(datetime, new_year):
# def change_year_of_ungridded_data(data, new_year):


import re
import argparse
    import dateutil.parser as du
    import dateutil.parser as du
from cis.time_util import cis_standard_time_unit
    from cis.time_util import PartialDateTime
    from datetime import timedelta
    from datetime import datetime
    """
    Parse a string as a number from the command line, or if that fails, as a datetime

    :param in_string: String to parse
    :return: int, float or DateTime
    """
    if string == 'None' or string is None:
        return None
    try:
        ret = int(string)
    except ValueError:
        try:
            ret = float(string)
        except ValueError:
            try:
                ret = _parse_datetime(string)
            except ValueError:
                raise argparse.ArgumentTypeError("'{}' is not a valid value.".format(string))
    return ret


def parse_as_number_or_standard_time(string):
    """
    Parse a string as a number from the command line, or if that fails, as a datetime in standard cis units

    :param in_string: String to parse
    :return: int, float (possibly representing a time in CIS standard time units)
    """
    res = parse_as_number_or_datetime(string)
    if isinstance(res, datetime):

# Path: cis/time_util.py
# class PartialDateTime(object):
#     def __init__(self, year, month=None, day=None, hour=None, minute=None, second=None):
#     def range(self):
#     def min(self):
#     def max(self):
#     def __eq__(self, other):
# def find_last_day_of_month(year, month):
# def calculate_mid_time(t1, t2):
# def convert_time_since_to_std_time(time_array, units):
# def convert_time_using_time_stamp_info_to_std_time(time_array, units, time_stamp_info=None):
# def convert_sec_since_to_std_time(seconds, ref):
# def convert_std_time_to_datetime(std_time):
# def convert_datetime_to_std_time(dt):
# def convert_julian_date_to_std_time(days_since):
# def convert_cube_time_coord_to_standard_time(cube):
# def set_year(datetime, new_year):
# def change_year_of_ungridded_data(data, new_year):


# Path: cis/parse_datetime.py
import re
import argparse
    import dateutil.parser as du
    import dateutil.parser as du
from cis.time_util import cis_standard_time_unit
    from cis.time_util import PartialDateTime
    from datetime import timedelta
    from datetime import datetime

    """
    Parse a string as a number from the command line, or if that fails, as a datetime

    :param in_string: String to parse
    :return: int, float or DateTime
    """
    if string == 'None' or string is None:
        return None
    try:
        ret = int(string)
    except ValueError:
        try:
            ret = float(string)
        except ValueError:
            try:
                ret = _parse_datetime(string)
            except ValueError:
                raise argparse.ArgumentTypeError("'{}' is not a valid value.".format(string))
    return ret


def parse_as_number_or_standard_time(string):
    """
    Parse a string as a number from the command line, or if that fails, as a datetime in standard cis units

    :param in_string: String to parse
    :return: int, float (possibly representing a time in CIS standard time units)
    """
    res = parse_as_number_or_datetime(string)
    if isinstance(res, datetime):

        res = cis_standard_time_unit.date2num(res)