(data_source_id)
Given a data source ID, try to guess its type (standard or aggregate).
Given a data source ID, try to guess its type (standard or aggregate).
Given a data source ID try to guess its type ( standard or aggregate ) .
def guess_data_source_type(data_source_id):
    """
    Given a data source ID, try to guess its type (standard or aggregate).
    """
    # ints are definitely aggregate
    if isinstance(data_source_id, int):
        return DATA_SOURCE_TYPE_AGGREGATE
    # static ids are standard
    if id_is_static(data_source_id):
        return DATA_SOURCE_TYPE_STANDARD
    try:
        # uuids are standard
        UUID(data_source_id)
        return DATA_SOURCE_TYPE_STANDARD
    except ValueError:
        try:
            # int-like-things are aggregate
            int(data_source_id)
            return DATA_SOURCE_TYPE_AGGREGATE
        except ValueError:
            # default should be standard
            return DATA_SOURCE_TYPE_STANDARD
def guess_data_source_type ( data_source_id ) : # ints are definitely aggregate if isinstance ( data_source_id , int ) : return DATA_SOURCE_TYPE_AGGREGATE # static ids are standard if id_is_static ( data_source_id ) : return DATA_SOURCE_TYPE_STANDARD try : # uuids are standard UUID ( data_source_id ) return DATA_SOURCE_TYPE_STANDARD except ValueError : try : # int-like-things are aggregate int ( data_source_id ) return DATA_SOURCE_TYPE_AGGREGATE except ValueError : # default should be standard return DATA_SOURCE_TYPE_STANDARD