def METHOD_NAME(sample_generator, batch_size):
    dataset = tf.data.Dataset.from_generator(
        sample_generator,
        output_types=(tf.float32, tf.int32),
        output_shapes=(4, 1),
    )
    dataset = dataset.shuffle(100).batch(batch_size)
    data_it = tf.compat.v1.data.make_one_shot_iterator(dataset)
    feature_values, label_values = data_it.get_next()
    features = {"x": feature_values}
    return features, label_values