iex/utils.py
def validate_range_set(range, range_set):
    """
        Validates that an appropriate range has been passed.

        range - the Range to be tested.
        range_set - the available range options. If 'date' is an option,
                    test for YYYYMMDD.
    """
    passing_criteria = []
    if 'date' in range_set:
        passing_criteria.append(type(range) == datetime.datetime)
        passing_criteria.append(parse_date(range))
    passing_criteria.append(range in range_set)
    if not any(passing_criteria):
        if 'date' in range_set:
            range_set[range_set.index('date')] = 'YYYYMMDD (int), datetime'
        err_msg = f"Invalid range: '{range}'. Valid chart types are {', '.join(range_set)}"
        raise ValueError(err_msg)
    else:
        url = f"chart/{range}"

        Validates that an appropriate range has been passed.

        range - the Range to be tested.
        range_set - the available range options. If 'date' is an option,
                    test for YYYYMMDD.
    
Validates that an appropriate range has been passed.
range - the Range to be tested.
range_set - the available range options. If 'date' is an option,
test for YYYYMMDD.
Validates that an appropriate range has been passed . range - the Range to be tested . range_set - the available range options . If ' date ' is an option test for YYYYMMDD .
def validate_range_set(range, range_set):
    passing_criteria = []
    if 'date' in range_set:
        passing_criteria.append(type(range) == datetime.datetime)
        passing_criteria.append(parse_date(range))
    passing_criteria.append(range in range_set)
    if not any(passing_criteria):
        if 'date' in range_set:
            range_set[range_set.index('date')] = 'YYYYMMDD (int), datetime'
        err_msg = f"Invalid range: '{range}'. Valid chart types are {', '.join(range_set)}"
        raise ValueError(err_msg)
    else:
        url = f"chart/{range}"
def validate_range_set ( range , range_set ) : passing_criteria = [ ] if 'date' in range_set : passing_criteria . append ( type ( range ) == datetime . datetime ) passing_criteria . append ( parse_date ( range ) ) passing_criteria . append ( range in range_set ) if not any ( passing_criteria ) : if 'date' in range_set : range_set [ range_set . index ( 'date' ) ] = 'YYYYMMDD (int), datetime' err_msg = f"Invalid range: '{range}'. Valid chart types are {', '.join(range_set)}" raise ValueError ( err_msg ) else : url = f"chart/{range}"
Validates that an appropriate range has been passed.
Validates that an appropriate range has been passed .
"""
        Validates that an appropriate range has been passed.

        range - the Range to be tested.
        range_set - the available range options. If 'date' is an option,
                    test for YYYYMMDD.
    """
range
range_set