def get_records(entityset, subject_id, entity_id, time_index=None, cutoff_time=None):
    entity = entityset[entity_id].df
    if ('SUBJECT_ID' in entity.columns):
        entity_df = entity[(entity['SUBJECT_ID'] == subject_id)]
    else:
        entity_df = entity
    if ((cutoff_time is not None) and (time_index is not None)):
        entity_df = entity_df[(entity_df[time_index] <= cutoff_time)]
    return entity_df
def get_records(entityset, subject_id, entity_id, time_index=None, cutoff_time=None):
    entity = entityset[entity_id].df
    if ('SUBJECT_ID' in entity.columns):
        entity_df = entity[(entity['SUBJECT_ID'] == subject_id)]
    else:
        entity_df = entity
    if ((cutoff_time is not None) and (time_index is not None)):
        entity_df = entity_df[(entity_df[time_index] <= cutoff_time)]
    return entity_df