human
Solve the following python programming problem given the following code:
# Create an input function reading a file using the Dataset API
# Then provide the results to the Estimator API
def read_dataset(filename_pattern, mode, batch_size = 512):
    def _input_fn():
        def decode_csv(line_of_text):
            columns = # TODO: Your code goes here
            features = # TODO: Your code goes here
            label = # TODO: Your code goes here
            return features, label
    
        # Create list of files that match pattern
        file_list = # TODO: Your code goes here

        # Create dataset from file list
        dataset = # TODO: Your code goes here

        # In training mode, shuffle the dataset and repeat indefinitely
        # TODO: Your code goes here

        # This will now return batches of features, label
        dataset = # TODO: Your code goes here
        return dataset
    return _input_fn
Given the above code, generate some markdown instructions for it.
assistant
#Here is the Python code you requested.

Create the input function
Now we are ready to create an input function using the Dataset API.
Exercise 2
In the code below you are asked to complete the TODOs to create the input function for our model. Look back at the previous examples we have completed if you need a hint as to how to complete the missing fields below. 
In the first block of TODOs, your decode_csv file should return a dictionary called features and a value label.
In the next TODO, use tf.gfile.Glob to create a list of files that match the given filename_pattern. Have a look at the documentation for tf.gfile.Glob if you get stuck.
In the next TODO, use tf.data.TextLineDataset to read text file and apply the decode_csv function you created above to parse each row example. 
In the next TODO you are asked to set up the dataset depending on whether you are in TRAIN mode or not. (Hint: Use tf.estimator.ModeKeys.TRAIN). When in TRAIN mode, set the appropriate number of epochs and shuffle the data accordingly. When not in TRAIN mode, you will use a different number of epochs and there is no need to shuffle the data. 
Finally, in the last TODO, collect the operations you set up above to produce the final dataset we'll use to feed data into our model. 
Have a look at the examples we did in the previous notebooks if you need inspiration.